#help-development

1 messages · Page 724 of 1

echo basalt
#

It also has a cloud thing that analyses your git

smoky oak
#

ah

#

thats why i cant see it

echo basalt
#

marketplace

smoky oak
#

yea

#

whats the annotation to mark a class/method as 'not unused' again?

echo basalt
#

@Deprecated

#

or what

smoky oak
#

@SuppressWarnings("Unused")

#

just

#

that it actually works

echo basalt
#

ehh

#

Just do it with your ide

smoky oak
#

this isnt for specific methods, so I'd rather do it like this

#

this isnt for the @EventHandler thing but for library classes

#

I'd rather not go through it with a comb

echo basalt
#

mans using java spring or what

river oracle
smoky oak
#

?

#

no im just splitting my code into two parts

#

@SuppressWarnings({"Unused"}) aint it either

#

seriously whats that annotation even doing

river oracle
#

Disable that intellij warning

#

It really is the dumbest thing ever

#

Or your entire library wil just be suppress warnings hell

smoky oak
#

I see
it cant be capitalized

#

ill just mark it as weak warning

sage dragon
#

Is there some API that lets me alter a mobs ai?

For example, make it neutral instead of passive

worldly ingot
#

See “Fixes” > “JDBC”

#

Driver was bumped from. .42 to .43 in this release but that’s one of the changes

#

Unsure why it’s “unsupported” when it worked before

upper hazel
#

this not be problem if i do so - private static final GaltapAutoMine instance = GaltapAutoMine.getInstance();

#

sonarList say this not good if i do getting plugin class in no-static metod (enable metod)

#

bc this static

worldly ingot
#

Seems the reason why Statement#getGeneratedKeys() does not work is because it only ever returned one generated key even if more than one entry was inserted. So the solution is to use theRETURNING clause in SQLite statements to get all automatically generated values in a ResultSet as getGeneratedKeys() would have (theoretically) done before. So your statement becomes:

INSERT INTO player_vaults (contents)
    VALUES ?
    RETURNING *;
upper hazel
#

yet these plugins can't look at the context of the code which

#

is what I was talking about when I wrote that sonarList can be too demanding

remote swallow
worldly ingot
#

Then your version of Hibernate needs an update

remote swallow
#

already using latest

worldly ingot
#

Either way, forwarded to md to see if maybe he wants to revert the driver update and give developers a warning for 1.21 instead to start using RETURNING clauses for SQLite

#

I'm sure others are affected by the change as well

smoky oak
#

my IDE yells at me to use final lol

opal juniper
#

something something micro optimisation

lilac dagger
#

i love micro optimizations

#

i love saving every bit of performance

remote swallow
opal juniper
#

or you can 😂

remote swallow
#

i cant english

upper hazel
#

Loops should not contain more than a single "break" or "continue" statement - sonarList - wth??

#

dev say this standard??

sage dragon
#

Can I manage the "popularity" system from villagers with a plugin?

I couldn't find anything

chrome beacon
chrome beacon
#

hard to read

young knoll
#

Early returns are good

#

Unless it’s in a loop apparently

#

:p

lilac dagger
#

to be honest if you separate the code into methods you shouldn't feel the need for multiple breaks or continue

upper hazel
lilac dagger
#

this should move it at the player location right?
BoundingBox boundingBox = player.getBoundingBox();
boundingBox.shift(player.getLocation());

#

i have to check if the bug is from somewhere else otherwise

chrome beacon
#

You can use more than one and have readable code

upper hazel
#

It just seems to me that sonarLint was written by devs from the 90s

#

due to the fact that there are controversial recommendations that can cause harm today

#

or too perfectionists

lilac dagger
#

what is sonarLint used for?

chrome beacon
#

linting

lilac dagger
#

that word is not in my vocabulary

chrome beacon
#

Basic code analysis

lilac dagger
#

oh

chrome beacon
#

It gives recommendations on how to improve your code

lilac dagger
#

is it better than intellij tho?

#

i guess intellij doesn't complain about 50 line methods

worldly ingot
#

Think of it this way. It's the same reason IntelliJ is better at allowing you to write Java code than Notepad is

#

It's designed to do that

alpine swan
#

what will this return if there are no solid blocks in the distance (since its notnull)

lilac dagger
#

air

worldly ingot
#

Linters are designed to analyze your code. IntelliJ is not specifically designed to do that, it just does it as a feature

worldly ingot
upper hazel
#

better, but you can say goodbye to good code readability
For me personally, var is inconvenient

alpine swan
lilac dagger
#

i don't like var either

alpine swan
#

alr

worldly ingot
#

I mean it could be non-air as well. Depends on what you put in your transparent block set

#

But yeah, generally air lol

young knoll
#

SonarLint be like WHY ARENT YOU USING AN ENUMMAP

remote swallow
#

DO THIS YOU FUCKING WHORE' spits on you

upper hazel
#

for material i was use enum map sonarLint was say it

lilac dagger
#

someone in here said enum map might not be that much better than a hashmap due to how many values it has

#

if you have like 5 materials enummap would have an array of the mat length anyway while hashmap will have 16? by default

upper hazel
#

internet say "enumMap better bc this for ENUM"

lilac dagger
#

but sometimes it is better

young knoll
#

Yeah but it won't be an enum one day

upper hazel
#

optimization etc.

young knoll
#

I am thinking ahead

lilac dagger
#

i looked at internals, it's pretty nice

#

i think it will until removed

upper hazel
lilac dagger
#

the changes will be done in 2 separate classes for blocks and items

#

the material will stay for backward compatibility

upper hazel
#

you mean this for another minecraft version?

lilac dagger
#

it's a pull request for spigot or something

upper hazel
#

adapt map for it?

lilac dagger
#

wait, i think i understand you wrong, what do you mean?

upper hazel
lilac dagger
#

yeah but it was debunked

#

the material class won't be the class that will be changed

upper hazel
#

good

lilac dagger
#

it'll stay an enum but deprecated for a while

#

and then removed

upper hazel
#

so enamMap not good for frequently changing types

#

someone can just change class

#

i mean dem

lilac dagger
#

yeah

upper hazel
#

dev

lilac dagger
#

but so can anything else be changed and break stuff down the line

#

don't worry about it

upper hazel
#

spigotMC not accept plugins which do not support the latest version no?

lilac dagger
#

there's nothing stopping you for making a plugin only for 1.8.8

#

but as i said, material will stay for backward compatiblity

upper hazel
#

I just read somewhere in the site rules

lilac dagger
#

that can't be true i think?

#

not sure

upper hazel
#

if this is true then this is not a good solution

#

for site

tardy glacier
#

hi

#

i have a problem with znpcs

#

I want to make it so that when I click on the npc, the ches commands will open. I have already tried CMD (the command) but it won't let me

winged anvil
#

?lj

#

wait

#

my bad not directed torwards you im just seeing what it says

#

?learnjava

undone axleBOT
proven jay
#

Hey, I'm trying to add a LuckPerms prefix onto my scoreboard with PlaceholderAPI and I have all of the expansions for it, but %luckperms_prefix% doesn't return anything at the moment except for when I do /papi parse Player %luckperms_prefix%

thin iris
#

surf board

chrome beacon
proven jay
chrome beacon
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

proven jay
#

Pretty much I have this colorize(translateHexColorCodes(rank)) and this gets the rank formatted right if I just put it in the chat, but when I try to add it onto the scoreboard, it doesn't show anything in it lol

chrome beacon
#

So uh are you actually translating the placeholder anywhere

proven jay
young knoll
#

Okay but are you using papi to parse the placeholder

proven jay
#

Yes

young knoll
#

where

echo basalt
lilac dagger
#

oh it does?

proven jay
echo basalt
lilac dagger
#

that's actually useful

chrome beacon
proven jay
#

I have PlaceholderAPI and the LuckPerms expansion in the server at the moment

echo basalt
#

and if you want to make it relative to 0,0,0 you just neg shift it

lilac dagger
#

yeah this was my problem then

#

i assumed it was relative to 0,0

proven jay
remote swallow
proven jay
echo basalt
#

the rank name and the rank prefix are two different things

#

let's start by that

chrome beacon
proven jay
#

I'm getting the rank's prefix at the moment

echo basalt
#

Do you have the luckperms papi expansion?

#

papi ecloud download Luckperms

proven jay
#

Yes

echo basalt
#

Rephrase your issue because I'm struggling to understand it

remote swallow
#

You need to call the setPlaceholders method

proven jay
#

Okay so forget LuckPerms entirely for the time being

#

I'll explain something else

#
  • I have a scoreboard.
  • This colorize(translateHexColorCodes(rank)) gets the rank's prefix.
    • It works on the scoreboard's title and in the chat.
    • It doesn't work when I put it in one of the scoreboard lines.
chrome beacon
#

So what exactly doesn't work

echo basalt
#

What are you assigning your rank variable to

#

Because I'm a solid 99.5% sure the problem isn't the scoreboard lines themselves

proven jay
echo basalt
#

Have you tried printing out this value

proven jay
#

Yes, this is the problem, it works all good in the chat

#

But not in one of the scoreboard lines

chrome beacon
#

What happens when you use it on the scoreboard

echo basalt
#

Well the method's yours

proven jay
#

If I add just rank onto the scoreboard, then it'll show the rank's prefix unformatted, but when I try to format on the scoreboard, it doesn't work

#

But when I format it in the chat, then it works all good

chrome beacon
echo basalt
#

wouldn't really make sense but yes, it's real below 1.13

young knoll
#

did someone say legacy versions

proven jay
#

I'm making it on 1.20 at the moment

echo basalt
chrome beacon
#

We don't have enough information to help

echo basalt
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

echo basalt
#

moment

proven jay
#

This .replace("%rank%", colorize(translateHexColorCodes(rank))) is what doesn't work in it at the moment

opaque scarab
#

If I’m storing a large amount of blocks in a chunk’s persistent data container, using a custom persistent data type, would it be bad to store block instances in a hashset, inside of this class?

young knoll
#

ur doing what

worldly ingot
#

THEY'RE STORING A LARGE AMOUNT OF BLOCKS IN A CHUNK'S PERSISTENT DATA CONTAINER

echo basalt
#

so..

#

a chunk

young knoll
#

I heard you like chunks

opaque scarab
#

Well first off, do block instances remain the same after a restart? I’m guessing they are instantiated when the chunk is loaded

young knoll
#

So I put a chunk in your chunk

opaque scarab
young knoll
#

The JVM shuts down…

worldly ingot
#

A new CraftBlock instance is created every single time you get a Block instance from the server. Blocks don't really exist

#

Blocks are purely a Bukkit concept

#

In reality, the server accesses blocks at an x, y, and z coordinate and map them to some state. There's only ever one instance of a state. Otherwise there would be like 65k or so instances of the same block state in a single chunk which will absolutely nuke the JVM's memory

remote swallow
#

Ur purely a bukkit concepr

proven jay
opaque scarab
remote swallow
#

No, choco

chrome beacon
opaque scarab
#

Oh

opaque scarab
chrome beacon
#

The exact raw value

remote swallow
young knoll
#

Studies show all instances are lost when the JVM isn’t running

opaque scarab
chrome beacon
#

Store what you need in the chunk pdc mapped to the block location

echo basalt
#

?blockpdc

undone axleBOT
chrome beacon
#

Unload and load the data as the chunks get loaded

proven jay
chrome beacon
echo basalt
#

homeboy copied his friend's message

proven jay
#

I'm on my phone lol

slender elbow
proven jay
#

I had to lol

thin iris
#

if i punch a player, is there a way to get where i punched him?

#

like a limb

remote swallow
worldly ingot
#

I mean I get it

#

But wtf

echo basalt
#

raytraceEntities

#

getHitPosition

#

:)

young knoll
#

Then you gotta do more math

#

Since the hitbox doesn’t perfectly match the player of course

echo basalt
#

I mean shit if you care about body part it's just some rotation and bounds checks

opaque scarab
# chrome beacon Store what you need in the chunk pdc mapped to the block location

Wish that would work for me, but sadly it probably won’t. The whole thing here is this. I’m working on a system to show different blocks to different players. When a chunk packet is to be sent out, a channel duplex handler get the chunk instance, and gets persistent data from the chunk. This data contains a series of blocks to override the original blocks, corresponding to the player. Those overriding blocks then are sent to the specific players.

chrome beacon
#

So what part doesn't work for you

slender elbow
chrome beacon
#

Large file size?

proven jay
opaque scarab
#

The data is for information about blocks, but I need to access it from the chunk

echo basalt
chrome beacon
#

So use the chunk pdc?

opaque scarab
echo basalt
#

you don't need to store each state for each player for each chunk in the pdc

chrome beacon
#

But yeah sounds like you might want to use smth else than pdc ^^

echo basalt
#

or if you want to use pdc, make sure you do optimized stuff

#

like pallettes

young knoll
#

I mean all block pdc is actually on the chunk

echo basalt
#

and bitsets :)

young knoll
#

Blocks don’t have pdc

echo basalt
#

yeah but the amount of data stored could be optimized

#

When I did client-sided blocks I basically just had my own chunk manager thing

young knoll
#

Chunk2

echo basalt
#

Real blocks would be set as air to avoid collision issues and we'd just send fake blocks on top of the real stuff

#

depending on the amount it might be better to send block change packets instead of chunk packets

young knoll
#

Make the entire server a void world

echo basalt
#

p sure it took like 60ms to read, update and send a chunk packet

young knoll
#

And completely build the chunk per player

echo basalt
#

per chunk

#

so we also had a thread pool for that

young knoll
#

If you only want to remap entire types you can make it way faster

echo basalt
#

and cancelled packets and sent them later

young knoll
#

By changing the palette instead

echo basalt
#

lot of pain

#

It's a lot easier to write your own copypaste thing with worldedit or bukkit's Structure

#

than to do the nms hackery

proven jay
echo basalt
#

I was a bit neglectful for a period of like 2 years so I fucked around and found out

opaque scarab
#

The whole story is I run a server that uses Geyser and Floodgate. I am adding custom blocks using noteblock block states and resourcepacks, but do to limitations, bedrock players can’t see these custom blocks. They just see the note locks. For them, I want to replace these custom blocks they can’t see with vanilla blocks that look similar, so it gives the same aesthetic

young knoll
#

Ah that’s easy then

#

You can just modify the palette and not loop the entire chunk

echo basalt
#

You should also split your code responsibility

#

make your own class for colorizing stuff

#

your code's a tiny bit unstable and I'm not THAT interested in resolving an issue I see as dumb

#

I should write a guide into debugging

chrome beacon
#

Use the ChatColor class for Hex

young knoll
#

Its format sucks tho

echo basalt
#

its

#

coll pls

proven jay
young knoll
echo basalt
#

debug your inputs by actually printing it out to the console

#

You could very much be translating and colorizing %luckperms_prefix% instead of the actual rank

chrome beacon
#

Or use a real debugger

echo basalt
#

nah System.out.println does the job fine

young knoll
#

Sysout solves 99% of my issues

#

The other 1% get the debugger

echo basalt
#

and for memo leaks we just print out our collection sizes

chrome beacon
echo basalt
#

if that doesn't work we check for player / location / entity hard refs and if that doesn't work we make a VM for yourkit's 2 week trial clown_2

opaque scarab
echo basalt
#

basically chunks have this thing called "the palette" which just says

#

"when you see a 5 it means 13"

and both the server and client have a shared "global pallette" which says
"dirt is 1"

#

Instead of the old 13:18 system or whatever each state has its own id

#

It's basically just a huge list of singleton states

#

What you can do is loop through the pallette embedded in the packet and replace ids that match noteblocks

#

with ids that match your target blocks

opaque scarab
echo basalt
#

yes

echo basalt
#

quite complex and you might need to read bits yourself

#

or you can cancel the packet, get the chunk position, wrap it around with some nms fuckery and change the nms pallette

young knoll
#

It’s easy with some viaversion api stuff

#

They have wrappers for it

echo basalt
#

now I get why ppl hate this

opaque scarab
#

Originally

echo basalt
#

from experience that caused FPS issues in mass amounts

#

you'll do fine

young knoll
#

So does bedrock not support textures on noteblock states

#

Lame

opaque scarab
young knoll
#

I guess you could remap it to custom blocks since bedrock supports those

opaque scarab
#

No custom model data or blockstates

young knoll
#

But that’s probably even harder

opaque scarab
opaque scarab
opaque scarab
young knoll
#

Yes

#

It needs to translate chunks itself after all

opaque scarab
young knoll
#

?paste

undone axleBOT
young knoll
#

That’s how I did it

#

Imports are from mojmap, protocollib and viaver

alpine swan
#

how can i synchronously process packets from protocollib BEFORE bukkit events that would use those packets are ran

using the bukkit scheduler (runTask) from a protocollib listener results in the code being ran after the event'

echo basalt
#

well

#

you can cancel the packet and do weird stuff

#

what you need it for anyways

eager jacinth
#

Hello. Recently I decided to study the REST API and therefore decided to write a small "banking" service, but I don't know how to better implement user registration.

The only thing that came to my mind was:

  1. Make a route (accessible only from localhost), say, "/register" and send a POST request to it when the player uses the command, say, "/bank createaccount".
  2. Use Discard OAuth, but then you will have to force players to link a Discord account, and not everyone uses it...

Can you suggest something?

sullen marlin
#

Banking for what lol

#

Tying it to discord sounds weird

halcyon hemlock
eager jacinth
halcyon hemlock
river oracle
#

tying it to account name should be enough

#

if you want to go way over the top add a password

sullen marlin
#

And then make it cryptocurrency

#

With Ur own blockchain

river oracle
#

then rug pull

#

and make millions 🥳

quaint mantle
#

integraring crypto into mc is aganist tos

river oracle
young knoll
#

I mean

#

That’s less of a joke than it seems

river oracle
#

rarely do you get terminated or blacklisted for that shit

#

most servers survive blacklists too they just don't gain players

dry forum
#

is there a free way or anything to host a mongodb

worldly ingot
#

I mean it's hardly "free" but if you purchase a host (shared or dedicated, whatever) you can always install and run a MongoDB instance alongside your server

eager jacinth
worldly ingot
#

Technically free, but hosts are a bit more expensive than just a Minecraft server host

haughty granite
#

hi, do you know where I could find the images of all the blocks/items in 1.20.2?

worldly ingot
#

I think some hosts will offer you SQL databases as well

echo basalt
#

it's what I use

haughty granite
young knoll
#

^

#

Atlas has a basic free tier

river oracle
eager jacinth
river oracle
#

for expressed purpose

eager jacinth
eager jacinth
haughty granite
#

I just want a damn .zip

eager jacinth
haughty granite
#

o m g

#

just want to do things to you

orchid gazelle
haughty granite
orchid gazelle
#

Huh?

young knoll
#

If I depend on a library via plugin.yml that is already included in spigot

#

Will the one from plugin.yml take priority

weak meteor
#

like

#

%appdata%/.minecraft/versions/1.20.2.jar

young knoll
#

You’ll get the texture from that

weak meteor
#

decompile that

#

thats what he needs isnt it?

young knoll
#

But they won’t be in the form of block models, if that’s what they want

weak meteor
#

well, there's both

haughty granite
young knoll
#

There isn’t

young knoll
haughty granite
#

I need a proof now 😭

weak meteor
#

mine and yours

#

idk

young knoll
#

Just the flat textures are in the jar

haughty granite
#

but I don't know how they render the texture afterwards

young knoll
#

With a rendering library

#

:p

weak meteor
#

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources (default-resources) on project ciroHub: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources failed.

What could be happening? pom.xml: https://paste.md-5.net/xatemikawu.xml

sullen marlin
#

Post full error/log

quaint mantle
#

what event causes entities (dropped items) to blow up

#

didnt mean to reply to that

echo basalt
#

prob EntityDamageEvent

young knoll
#

Does that fire for non living entities

echo basalt
#

yes

#

p sure

#

not sure if item frames count get shot by bows

#

but there was something that def could

proven jay
#

@echo basalt Are you still here?

#

I've debugged the problem a little bit more

echo basalt
#

it's 2am but sure

#

fuck it why not

dry forum
#

what would be the best way to check when a person clicks a certain block? i have a lot of blocks that people can click and each block has values with it, so whats the best way to go about this? i assume theres a better way then storing the location in a file along with any data

proven jay
#

This is what it's supposed to be (This is sent in the chat)

#

This is what it is at the moment (This is in the scoreboard)

echo basalt
#

Fun

proven jay
#

Yeah

#

So

echo basalt
#

Now, are you translating colors before hex

#

or opposite way

#

and do scoreboards even support the §x bullshit or should you be using components

proven jay
proven jay
#

I'll look into it

echo basalt
#

show scoreboard text pls

#

like where you set the lines

#

prob in your lib

#

Just like

#

is it using team names or team prefixes

#

that's the important bit

proven jay
echo basalt
#

that's not the scoreboard code

proven jay
echo basalt
#

still no

proven jay
#

What?

echo basalt
#

looking for the actual bukkit scoreboard stuff

#

I remember you used a lib called aether for that

proven jay
#

Yes

echo basalt
#

Is it foss, could you replace it with your own just to be sure

#

okay yeah it uses board text instead of like

#

fucking prefixes

#

use this, be haoppy

proven jay
#

What's the difference in it?

echo basalt
#
SimpleBoard board = new SimpleBoard();

board.setTitle(TextUtils.color("&aJoe");
board.displayList(List.of(
  "Hey",
  "There"
));

board.display(player);
echo basalt
#

It's also simple

#

you'll probably want to handle placeholders somewhere

#

Up to you how you use it

proven jay
#

I see yours is simple, but I like the way the Aether API is setup at the moment, is there anyway I can fix it?

echo basalt
#

Make an impl simpler to aether

#

problem with aether is that it uses team names which don't support rgb colors

#

:)

#

That's literally it

proven jay
#

How come it works in the scoreboard title?

echo basalt
#

Because the scoreboard title doesn't rely on teams

#

It's a bit complex and I don't fully understand it

#

But the scoreboard has "objectives" and "teams"

#

The idea is that we assign an objective to the scoreboard and every team has its own score for that objective

#

What we do here is just create a bunch of teams with legacy chatcolor names so the name is invisible

#

And we assign our colorful rgb stuff as prefixes and suffixes

#

Team names trip up if they have rgb colors for a reason

#

Titles aren't tied to the objective or any of the teams

#

They're tied to the sidebar

elfin blaze
#

Hello !
I'm trying to make a custom villager exchange with a JSON,
But some "random" blocks, although well written in my json, don't appear. I have the impression that they are blocks from fairly recent versions (maybe not, spruce_lab, are not recognize too, so idk)
I'm on spigot 1.20.1
https://paste.md-5.net/jilahukoho.cs

young knoll
#

Is your api-version set

worldly ingot
#

Also, Material#matchMaterial() > Material#getMaterial() so you can use keys

#

Or, better yet, Registry.MATERIAL.match()

young knoll
#

They use both match and get

#

For some reason

worldly ingot
#

YEah

#

PICK A LANE

tender shard
#

@worldly ingot cannot blame ppl for not using the registries

#

nobody knows they exist

#

because spigot got no official blog and md or contributors never care about writing wiki articles

#

we need an official news source

#

and NO; the changelog viewer is not enough

#

for example the PlayerProfile API, I have the feeling that my blog post is the only reason why people about it AT ALL

young knoll
#

Spigot news

#

Hosted by Alex Jones

slender elbow
#

i suspect/hope (bukkit) registries will become a) more useful, and b) more known about after the enum eradication PR, but that solely depends on what "alternatives" to the Whatever.getByName etc the PR provides;; ideally, none, and it would just redirect you to the Registry interface

worldly ingot
#

That's the plan

slender elbow
#

I'll take credit for it

worldly ingot
#

oh okay

slender elbow
#

you can have some, dw

#

sharing is caring, or... something

vale knoll
#

How would I use a hexcode for a chat color?

#

(ChatColor.RED + "Test") where ChatColor.RED is replaced with a hexcode.

young knoll
#

ChatColor.of(“#123456”)

vale knoll
#

of is not a method of ChatColor.

worldly ingot
#

net.md-5 package, not org.bukkit

vale knoll
#

Ah, gotcha.

young knoll
#

org.bukkit.ChatColor is stinky

quaint mantle
#

is the naming convention NMSVersion or NmsVersion

worldly ingot
#

Matter of preference

#

I personally capitalize acronyms but others don't

#

You see it a lot with API vs Api

tender shard
#

ONLY ADD MAJOR API CHANGES

opaque scarab
#

I'm transfering a project to another PC. Everything was fine before, but now, I'm getting this InteliJ problem: "Dependency 'ca.bkaw:paper-nms:1.20.1-SNAPSHOT' not found" Reloading maven gives me this error: "ca.bkaw:paper-nms:jar:1.20.1-SNAPSHOT was not found in https://repo.papermc.io/repository/maven-public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of papermc-repo has elapsed or updates are forced"

This is the maven plugin: https://github.com/Alvinn8/paper-nms-maven-plugin

Here is the dependency (directly from my pom.xml):

<dependency>
            <groupId>ca.bkaw</groupId>
            <artifactId>paper-nms</artifactId>
            <version>1.20.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
GitHub

A maven plugin for using NMS on paper with Mojang mappings. - GitHub - Alvinn8/paper-nms-maven-plugin: A maven plugin for using NMS on paper with Mojang mappings.

#

If no one can help, that’s understandable as this is related to paperMC

tender shard
#

or more than one?

slender elbow
#

did you declare the plugins repository like the readme shows?

tender shard
#

easist solution would be to just properly use the official spigot specialsource plugin

#

?nms

opaque scarab
tender shard
#

so you solved it already?

opaque scarab
#

Yeah just now

tender shard
#

ok great

#

yeah that plugin obviously requires jdk17+

opaque scarab
#

Thanks for the help everyone!

opaque scarab
tender shard
#

although we didn't do anything helpful, always welcome lol

#

although you should REALLY think about switching to gradle paperweight-userdev instead

#

it will save you much trouble in the future

#

spigot = maven
paper = gradle

#

the plugin you linked mention it in its readme too

opaque scarab
tender shard
#

yeah well both the specialsource plugin for maven, as well as the e.g. the shadow or userdev plugin gradle is "third-party" sooo

#

but as long as you got it working now, that's great

young knoll
#

This is like

#

4th party

opaque scarab
#

By 3rd party I mean if that one guy decides to stop updating the maven plugin, my plugin can’t update. Userdev was made by the same developers as paperMC I’m pretty sure

opaque scarab
tender shard
young knoll
#

5th party

opaque scarab
young knoll
#

It’s parties all the way down

tender shard
#

javadoc.exe = first hand
maven or gradle javadoc = second hand, I guess
so mine would be third hand?

opaque scarab
#

3rd party: Spigot API / Paper API, 4th party: makes things that use and/or are for said APIs

tender shard
#

unless your build file is severely cursed, your spigot api or paper api .jar would be a normal dependency just like the jdk itself is

young knoll
tender shard
#

you know less about gradle than I do

#

and that's a severe insult, coll

young knoll
#

I’m convinced no one knows gradle

#

Even the devs

tender shard
#

yes, that is true

young knoll
#

Maybe I’ve just been hallucinating the existence of gradle for all these years

quaint mantle
#

Gradle is confusing

tender shard
#

or as the gradle devs would call it it: !Booleans.FALSE!!

young knoll
#

And whenever I mention it people just think I’m insane

tender shard
#

you need about one to two weeks to fully understand how it works

#

and after that you know exactly how it works and then you think "was this really worth it, or could I have just sticked to maven with the maven-versions plugin?"

#

and the answer is always "well"

young knoll
#

Desert well

tender shard
#

TL;DR: 99% of gradle users would be better off just using maven and the 1% of maven users who refuse to use gradle are at their own fault

#

gradle starts to become even slower than maven once you have javadocs task that depend on "each other"

#

I never really understood the reason why anyone would even need to "code" their build scripts

#

(which doesn't mean there is no valid use case, it just means I never encounctared any myself)

river oracle
#

wo Alex doesn't hate gradle now

#

what a change of character after all those rants

tender shard
#

have you missed the last 4 weeks or what

river oracle
#

I've kinda been in and out since the end of july tbh

tender shard
#

ah ok

river oracle
#

school nd all been kinda busy until recently now that I got going

tender shard
#

yeah I have indeed learnt that i has many nice features that are missing in maven

#

but truth be told, maven 4 will be evaporating them all

#

on the other hand, people have been waiting for maven 4 since like, idk, 5 years now?

river oracle
#

isn't it in betas now

#

I saw some references to maven 4 on their docs

tender shard
#

I will give a one sentence TL;DR:

#

Gradle is very powerful and it's not at bad at all, but if you want to code a minecraft plugin and you do not already know gradle by heart, then it's the worst build system you could choose

#

gradle is great for people who are geniuses and know EVERYTHING

slender elbow
#

i'm flattered

tender shard
#

if you EVER had to copy/paste something from stackoverflow to make your gradle build work, you're not ready for gradle's power yet

#

if you EVER had to ask somewhere someone about gradle in the last 2 years, chances are high you're not stupid, but gradle devs are just too ignorant about actual users

#

maybe both is true? who knows

#

gradle is not bad. but gradle is not always the best tool to choose

river oracle
#

my main complaint with gradle is I feel like the docs just weren't super useful when I was setting stuff up. I honestly just went back to maven for my project seeing as I was never like "oh I wish maven had/did this"

rough ibex
#

you do not use gradle
gradle uses you

tender shard
#

gradle is 40 ton 8 axle truck. you can haul many cargo. but yo ujust wanna go on vacataion with your family? better take your normal car (maven) lol

river oracle
#

main thing I don't get about gradle is how could it do something maven can't e.g. you can pretty much code some pretty insane maven plugin if you wanted

tender shard
#

also gradle IS SLOWER for multi module projects that depend on each other if they have different interacting lifecycles

#

people always claim gradle is faster, which is not true

tender shard
#

it is faster 90% of the time (if you ignore the 30 seconds startup time)

#

but not always

topaz cape
#

whats 1.20.2 nms version ?

river oracle
#

1.20.2

#

👍

topaz cape
#

whats the nms version smh

tender shard
#

he means the craftbukkit package

topaz cape
#

yes

tender shard
worldly ingot
river oracle
#

gross you do it like that? I just convert everything into easy to read strings lol

topaz cape
#

a certified one

#

by... my dad

#

anyways

tender shard
#

yeah ok understandable. tbh I also don't know if CRAFTBUKKIT (!!!) has a new package name for 1.20.2, if you find out pls ping me and lemme know

#

because I'd also like to know

#

thanks

topaz cape
#

i guess i have to build it

river oracle
#

wait I use NMS in my projects 😭 I have to copy and paste agian

#

the worst part about NMS is copy pasting all your code from one module to the other real shame

river oracle
#

I should probably make a plugin or something to do this for me

#

or / script

topaz cape
#

R2????

#

SHIT

worldly ingot
#

There were significant internal changes, so yes

river oracle
topaz cape
#

ill have to update ModernDisguise

#

😭

worldly ingot
#

But there are obviously more non-patched files that were updated too

#

The new configuration protocol phase ended up changing a lot

topaz cape
#

so this version isnt going to be some easy copy & paste

#

lets find out shall we?

river oracle
#

RecipeHolder woh mojang

topaz cape
#

what now

river oracle
#

you see it sounds so much more interesting than it is

topaz cape
#

oh its just the old IRecipe

river oracle
#

it quite literally just holds a recipe 👍

tender shard
#

thanks

#

here we go again

river oracle
#

yay get to use new bt gui

#

for new verison

#

time to update suketto

topaz cape
#

this is now used to spawn players

#

this is crazy

quaint mantle
topaz cape
#

Caused by: java.lang.NoSuchMethodError: 'java.lang.String com.mojang.authlib.properties.Property.getValue()' WHAT THE FUCk

carmine mica
#

Property is a record, so its just "value()"

topaz cape
#

they changed that now

#

wow

#

oh

#

thats not the case

carmine mica
#

well thats the Map, the Property is a record

topaz cape
#

wait

#

its still the same

#

???

carmine mica
#

probably looking at an old version or something

#

its def a record

topaz cape
#

hmm

topaz cape
#

i managed to fix it

#

btw does anybody know the new name of PacketPlayOutNamedEntitySpawn

teal wagon
#

players use the existing add entity packet now

tender shard
#

how do you people deal with customers who have issues only with bedrock issues? do you blatantly tell them "no spigot/no java = not my issue, or just refund them instantly, or check out the problem and only refund if you notice they need bedrock support but it's not possible with just spigot api/ .... ?"

#

once I figured out the issue really only occurs for bedrock users, and I notice it's important for the buyer that they care about bedrock users not having issues, I just refund them, no questions, asked, even if their purchase is like >3 months ago. However this is getting annoying. why do server owners take it for granted that plugin devs have to care about geyser issues? 😢

topaz cape
#

in some huge red font

fossil flax
#

how can i prevent tab complete for a player that don't have the permission to run the command?

grave plover
lost matrix
alpine swan
#

are protcollib listeners async always

lost matrix
#

Yes, packets are handled disjoint from spigots main thread

alpine swan
#

world.rayTrace will only returns result with a block OR entity, not ever both, right

lost matrix
#

It will stop at the first hitbox, yes

#

There are methods for tracing exclusively for blocks or entities

rough drift
#

people just skip all the relevant text

#

go to discord

#

and spam you there

gusty bough
#

Hello, I'm trying to generate a world without ocean biomes.
I have this custom ChunkGenerator :

public class CustomBiomeGenerator extends ChunkGenerator {

    private final List<Biome> oceanBiomes = List.of(Biome.OCEAN, Biome.DEEP_OCEAN, Biome.COLD_OCEAN, Biome.DEEP_COLD_OCEAN,
            Biome.FROZEN_OCEAN, Biome.DEEP_FROZEN_OCEAN, Biome.LUKEWARM_OCEAN, Biome.DEEP_LUKEWARM_OCEAN, Biome.WARM_OCEAN);

    @Override
    public @Nullable BiomeProvider getDefaultBiomeProvider(@NotNull WorldInfo worldInfo) {
        final BiomeProvider vanilla = worldInfo.vanillaBiomeProvider();
        return new BiomeProvider() {
            @Override
            public Biome getBiome(WorldInfo worldInfo, int x, int y, int z) {
                org.bukkit.block.Biome biome = vanilla.getBiome(worldInfo, x, y, z);
                if (CustomBiomeGenerator.this.oceanBiomes.contains(biome)) {
                    return Biome.PLAINS;
                }
                return biome;
            }

            @Override
            public @NotNull List<Biome> getBiomes(WorldInfo worldInfo) {
                return vanilla.getBiomes(worldInfo);
            }
        };
    }

    @Override
    public boolean shouldGenerateNoise() {
        return true;
    }

    @Override
    public boolean shouldGenerateSurface() {
        return true;
    }

    @Override
    public boolean shouldGenerateBedrock() {
        return true;
    }

    @Override
    public boolean shouldGenerateCaves() {
        return true;
    }

    @Override
    public boolean shouldGenerateDecorations() {
        return true;
    }

    @Override
    public boolean shouldGenerateMobs() {
        return true;
    }

    @Override
    public boolean shouldGenerateStructures() {
        return true;
    }
}

The problem I encounter is that terrain generation is not only based on biome as you can see on this image, I got a plains biome but still have an ocean...
Do someone know how I can fix that?

rough drift
lost matrix
#

That was the plan

gusty bough
#
            @Override
            public @NotNull List<Biome> getBiomes(WorldInfo worldInfo) {
                return vanilla.getBiomes(worldInfo).stream().filter(biome -> !CustomBiomeGenerator.this.oceanBiomes.contains(biome)).toList();
            }
#

Yeah but we cannot remove biomes from registry

#

As older versions

alpine swan
#

if you call runTask from a bukkit event, will the task be ran later on the same tick?

gusty bough
#

Even with reflections I couldn't

#

private static final fields with java 17+

alpine swan
#

also, when using runTask, will the tasks be ran in order of how the runTask method was called

lost matrix
#

No, the earliest point in time where scheduled tasks will run is the next tick.

gusty bough
#

I would love to get the code if so because I tried all yesterday and couldnt

lost matrix
alpine swan
lost matrix
#

None

gusty bough
#

Already tried doesnt work

alpine swan
#

oh alr

#

thanks

gusty bough
#

I deleted everything as it didnt work but i can code it again

smoky anchor
#

are you trying to remove biomes from the vanilla registry ?

gusty bough
#

Yes

smoky anchor
#

. . . Why is the registry private static final ?

lost matrix
#

The usual interact packet

smoky anchor
#

Something may have changed but I believe the fields were accessible

gusty bough
#
        try {
            Field field = Biomes.class.getField("S"); //OCEANS
            field.setAccessible(true);
            field.set(Biomes.class, Biomes.PLAINS);
        } catch (Exception ex) {
            ex.printStackTrace();
        }

Error :

smoky anchor
#

That... is not how you edit the registry

gusty bough
#

Well i would love some help if it isnt the registry x)

#

I though that it was Biomes class

#

net.minecraft.world.level.biome

smoky anchor
#

All the registries are in one class (probably Registries or Registry)
Then there is BIOME
You have to unfreeze the registry probably to edit it.

At least that is how I managed to add a block server side :D

gusty bough
#

If it reminds you something

#

I maybe found registry you talk

#

but still public static final

lost matrix
#

That is still a key

smoky anchor
gusty bough
#

Its in registry class

#

package net.minecraft.core.registries;

smoky anchor
#

It's not what you're looking for

#

It should be Registry<Biome> not a ResourceKey

gusty bough
#

The only thing with Registry I found is this sadly

undone axleBOT
smoky anchor
#

that is probably the class you want

gusty bough
smoky anchor
#

I think that should be it
You have to unfreeze the registry and them remove the correct BiomeSource ig

gusty bough
#

BiomeSource does have possibleBiome fields but again final field

undone axleBOT
gusty bough
#

Mhh can you provide code, as I did show you i get an error

#

while modifying final fields

upper hazel
#

app updates are evil

#

i was update plugin for intelji now this plugin not free🥲

#

and when I was update intellij itself it began to freeze more often

undone axleBOT
quaint mantle
#

org.bukkit.event.entity.ProjectileHitEvent has problem on 1_20_R2?

#

NBT_v1_20.java

#

HitEvent.java

lost matrix
#

This all can be done without nms and craftbukkit btw

twin venture
lost matrix
twin venture
#

the item on courser

#

is being deleted

#

after i close the inv

lost matrix
twin venture
#

i want to fix that

lost matrix
#

Some plugin does that. Items on the cursor dont get deleted randomly.

twin venture
#

can it be because iam removing player inventory in some point?

lost matrix
wide coyote
#

whats new in minecraft 1.20.2

eternal night
#

Villager trading fixed

wide coyote
#

thats it?

eternal night
#

a shit load of technical stuff

echo basalt
#

a bunch of protocol things changed

#

p much

#

as well as chunk nbt stuff

quaint mantle
small current
#

quick question

if i modify the playerInventory.getArmorContents array, will the armors be modified?

#

not feeling like trying

echo basalt
#

I'd call setArmorContents

small current
#

aight thx

echo basalt
#

it makes a craftbukkit copy every time the method is called

#

so yeah immutable

#

or well

#

defensive copy

#

whatev

small current
#

it has always 4 elements?

eternal oxide
#

yes but don;t assume it always will

upper hazel
#

if i lisen blockBreak event build flag can not worked in worldguard?ъ

#

i was testing this really not work

#

but idk this is bc i lisen event or not

young knoll
#

What

upper hazel
#

build sendy not work

#

deny

gleaming grove
#

is it possible in java to use generic like this?

#
    {
        return null;
    }```
#

nvm

smoky oak
#

Can someone explain why my IDE corrects a word A to word B then corrects word B to word A ?

#

Bezier -> bézier -> Bezier

gaunt sonnet
#

hey how can i connect with my bot to a spigot plugin?

pseudo hazel
#

what is your bot

gaunt sonnet
#

phyton?

pseudo hazel
#

i mean whats it for

gaunt sonnet
#

check status

#

etc

pseudo hazel
#

do you mean like a discord bot?

lilac dagger
quaint mantle
#

Hi, I have a very... specific question to ask. It's not that much about spigot, but I know you guys are always helpful. 🙂
So... I want to create a new minecraft server, that would use my own plugin(s). I want to ask, how I could hide some code from other devs. For example, I have a class file with all the "magic" in it and I want to make sure, that this class file can only be accessed through an interface. Is it possible to hide some class files somehow, but make the plugin still work properly?

young knoll
#

Make it package private

quaint mantle
#

Ohm... how exactly?

young knoll
#

Don’t put a modifier on the class

quaint mantle
#

Ye, I know this. But... how does this help to hide the source code from others?

worldly ingot
#

Well it's worth noting that package privacy only allows you access within, as the name implies, the same package. So if you make a subpackage you won't be able to access it

#

If you're wanting to design an API you would probably want to create a second API module that consists primarily of interfaces which your plugin can then implement

#

API will be available at runtime but you can distribute a separate API artifact that contains only the interfaces

#

This is what Bukkit and CraftBukkit are

quaint mantle
#

Yes. This is an example I wanted to say. How can I do that?

mortal hare
gaunt sonnet
worldly ingot
#

If you're using Maven or Gradle, create a new module for your API, and one for your implementation (your plugin code). Your plugin module should depend on your API module so that you can actually get the files. Your API should have some sort of primary interface that can be set by your implementation. Bukkit's primary interface is Server and you'll notice that the Bukkit class has a setServer(Server) method to drive the whole implementation

#

Then it's just a matter of making interfaces in your API and having your implementation actually implement those APIs, return them in the correct places, etc

quaint mantle
young knoll
#

It’s worth noting though that nothing in java will be truly hidden

worldly ingot
#

You can look to Bukkit and CraftBukkit as a decent example of how to go about doing this

young knoll
#

You can always access something if it’s loaded by the JVM

quaint mantle
young knoll
#

Quick get the ASM

#

Replace all his strings with beans

elfin blaze
#

I've got a problem, here's my NPC's custom exchange (I used Registry.MATERIAL.match as you advised to set the items in the NPC's inventory)
Here's my method for custom exchanges with my NPC, for the deepslate items my debug tells me it's an AIR type block, and the method doesn't work on it, whereas if I do it on the old blocks, basic "diamond_ore" style, my method works perfectly, any ideas?
https://paste.md-5.net/cuvoroquke.cs

tidal kettle
#

Hello Can i add Metrics to my bungeeCord plugin with gradle?

tidal kettle
#

How i try but it don't work

twin venture
#

is it possible to get the item on courser in the opned invenvetory?

smoky anchor
twin venture
#

the inventory will be closed when that happens ..

lost matrix
young knoll
lost matrix
young knoll
#

We also asked this last time

elfin blaze
twin venture
#

i tried both , it send me the correct name of the item ,when i tried to debug it , but it does not add it

tidal kettle
young knoll
elfin blaze
twin venture
lost matrix
#

wait what kind of metrics are we talking about

tidal kettle
#

I don't understand everything but i try to add bstats

lost matrix
gaunt sonnet
#

Hey I want to code a bot in java with my SpigotAPI plugin. However, I don't know how to do that, let alone how to import something into Maven

tidal kettle
young knoll
#

You can use it with gradle

tidal kettle
lost matrix
young knoll
#

Ah bStats doesn't have a gradle example

#

Lame

lost matrix
#

And there is no best approach to this, so many ppl will give you different advice. This needs to be engineered solo in most cases.

lost matrix
gaunt sonnet
#

because I don't want to learn a new language

tidal kettle
young knoll
#

Fairly basic example that shades and relocates bStats

#

It does have some other stuff but yeah

lost matrix
#

If you know how dependency managers work, then it doesnt matter if you use gradle or maven...

#

*But maven has a much greater coverage. Especially in the spigot community.

tidal kettle
onyx fjord
#

@molten hearth

worldly ingot
# young knoll It does have some other stuff but yeah
plugins {
    id "com.github.johnrengelman.shadow" version "7.1.0"
}

dependencies {
    implementation group: 'org.bstats', name: 'bstats-bukkit', version: '2.2.1'
}

shadowJar {
    relocate 'org.bstats', 'me.jishuna.minetweaks.libs.bstats'
}

build {
    dependsOn shadowJar
}

simplified

onyx fjord
#

quantum computers are no more

young knoll
#

ty choco

elfin blaze
# young knoll Share the error

With the API version, it works half way, it doesn't remove the block from the player's inventory if it's a deepslate block, classic blocks like "diamond_ore" if it does remove it for me, but it works already better

#

i'm dumb, it's just work

#

thanks for the tips

worldly ingot
# young knoll ty choco

also wtf, you used tabs and spaces in that build script and some lines have extra spaces at the end

#

What's up with that?

young knoll
#

Uhh

#

It's 2 years old and I didn't have an eclipse plugin to format groovy stuff back then

mortal hare
#

migrate to kotlin

#

its now defacto default for gradle

#

and dejure

young knoll
#

I'll kotlin you

echo granite
#

When Vault is not on the server, why

This code generates NoClassDefFoundError:

Supplier<Economy> factory = () -> null;
```But this code does not?
```java
Supplier<Economy> factory = new Supplier<Economy>()
{
    @Override
    public Economy get() 
    {
        return null;
    }
};
worldly ingot
#

I believe lambdas will generate methods, and obviously having a method with the Economy return type will require it to be loaded, causing the NCDFE to be thrown. Though if you're creating an anonymous inner class that may not necessarily be the case because generics are not available at runtime

forest pumice
#
Caused by: java.lang.NoSuchMethodError: 'org.bukkit.persistence.PersistentDataContainer org.bukkit.inventory.meta.ItemMeta.getPersistentDataContainer()'

Why does this happen?

young knoll
#

Get the bytecode!

forest pumice
#

Did it get updated

worldly ingot
#

PDC was added in 1.14 so that error should only ever be thrown in 1.13 or lower

echo granite
young knoll
#

PDA

#

new public display of affection API

worldly ingot
young knoll
#

Get on it choco

worldly ingot
#

To be fair...

ancient plank
#

Huh

young knoll
#

🤔

echo granite
worldly ingot
#

It's a generic in the anonymous class

#

I don't think it's generic when the synthetic method is generated

#

I'm taking a guess tbh

young knoll
#

Like I said get the bytecode

worldly ingot
#

Would probably reveal more information, yeah

smoky oak
#

can comparable result in 'equal'

young knoll
#

yes

#

returning 0 means equal

sweet flax
#

does anyone has 1.20.1 nametags API? cuz there is no PacketPlayOutScoreboardTeam packet

late fossil
#

Hey! I've been trying to make a item that changes when someone clicks it and im trying to use it as a vanish toggle. Can someone tell me what i did wrong here? @EventHandler public void OnRightClick(PlayerInteractEvent e) { Player player = e.getPlayer(); PlayerInventory inv = player.getInventory(); ItemStack vanish = new ItemStack(Material.LIME_DYE); ItemMeta vanishMeta = vanish.getItemMeta(); Action action = e.getAction(); if(player.getItemInHand().getType() == Material.GRAY_DYE && player.getItemInUse().getItemMeta().getDisplayName().equals((ChatColor.GRAY + "Vanish ei ole päällä"))) { if(action.equals( Action.RIGHT_CLICK_AIR ) || action.equals( Action.RIGHT_CLICK_BLOCK )) { vanish.setType(Material.LIME_DYE); vanishMeta.setDisplayName(ChatColor.GREEN + "Vanish on päällä"); vanish.setItemMeta(vanishMeta); staffMode.enableVanish(player); inv.setItem(0, vanish); } } else if ((player.getItemInHand().getType() == Material.LIME_DYE) && player.getItemInHand().getItemMeta().getDisplayName().equals((ChatColor.GREEN + "Vanish on päällä"))) { if(action.equals( Action.RIGHT_CLICK_AIR ) || action.equals( Action.RIGHT_CLICK_BLOCK )) { vanish.setType(Material.GRAY_DYE); vanishMeta.setDisplayName(ChatColor.GRAY + "Vanish ei ole päällä"); vanish.setItemMeta(vanishMeta); staffMode.disableVanish(player); inv.setItem(0, vanish); } } }

young knoll
#

Well

#

What is happening

#

And what do you want to happen

late fossil
# young knoll What is happening

rn nothing happens but i want it to switch the item between lime dye and gray dye when the player right clicks it in their hand

young knoll
#

Does the event fire

late fossil
#

it did before

worldly ingot
#

You're using getItemInUse() instead of getItemInHand() in your first if statement

worldly ingot
#

Either way, PlayerInteractEvent should have a getItem() you can use directly instead

#

Makes things a bit easier

#

It can be null however

late fossil
#

"org.bukkit.inventory.ItemStack.getItemMeta()" just noticed this in the console

worldly ingot
#

That doesn't mean too much to use but it's probably an error and likely caused by the fact you're doing getItemInUse().getItemMeta() despite there being no item in use

#

Items in use are things like bows, or shields

quaint mantle
late fossil
ivory sleet
#

Where there is no anonymous class for lambda basically

#

and then you use invokedynamic instead also

lilac dagger
#

lambdas are amazing vs anonymous classes

late fossil
#

nvm it just started working randomly

ancient plank
#

you can also change the existing itemstack instead of creating a new itemstack

quaint mantle
young knoll
#

InvokeDynamic is love

ivory sleet
#

Yeah also what choco said, you get that reified generic in the anonymous class

lilac dagger
ivory sleet
#

which I mean, boop crash ehrgm

worldly ingot
#
    @EventHandler
    public void OnRightClick(PlayerInteractEvent e) {
        Player player = e.getPlayer();
        Action action = e.getAction();
        ItemStack item = e.getItem();

        if (action != Action.RIGHT_CLICK_AIR && action != Action.RIGHT_CLICK_BLOCK) {
            return;
        }

        if (item.getType() == Material.GRAY_DYE && item.hasItemMeta() && item.getItemMeta().getDisplayName().equals(ChatColor.GRAY + "Vanish ei ole päällä")) {
            item.setType(Material.LIME_DYE);
            ItemMeta itemMeta = item.getItemMeta();
            itemMeta.setDisplayName(ChatColor.GREEN + "Vanish on päällä");
            item.setItemMeta(itemMeta);
            staffMode.enableVanish(player);
        }
        else if (item.getType() == Material.LIME_DYE && item.hasItemMeta() && item.getItemMeta().getDisplayName().equals(ChatColor.GREEN + "Vanish on päällä")) {
            item.setType(Material.GRAY_DYE);
            ItemMeta itemMeta = item.getItemMeta();
            itemMeta.setDisplayName(ChatColor.GRAY + "Vanish ei ole päällä");
            item.setItemMeta(itemMeta);
            staffMode.disableVanish(player);
        }
    }```
ancient plank
#

I just had a brain off moment, but what choco posted is what I meant

worldly ingot
#

That would work

quaint mantle
worldly ingot
#

Simplifies things a bit as well

quaint mantle
#

Imo

ivory sleet
#

You ideally only want to use lambda syntax for @FunctionalInterface annotated interfaces

sweet flax
young knoll
#

Choco spoonfeed

#

smh

ivory sleet
#

🥄

young knoll
#

It will be ClientboundSomethingSomething

#

?mappings

undone axleBOT
quaint mantle
young knoll
#

net.minecraft.network.protocol.game.ClientboundSetPlayerTeamPacket

worldly ingot
#

1.20.1

#

Just recently

undone axleBOT
young knoll
#

Ah F it's not bound to a location

#

And there is no way to bind it to a location

worldly ingot
#

Right. It's meant to send tile state updates

young knoll
#

Fair

#

Still doesn't let me do what I wanted tho, big sadge

#

This was a while ago

#

Working with Structures as their individual blocks/entities

#

Bukkit has a Structure api

#

You can break the structure down into BlockStates and entities

#

But neither of them will be bound to a world, and there is no way to do so

#

PDC would be in the BlockState

#

(If it's a tile entity)

#

No

#

There is no method to add an entity to a world, because bukkit expects them to always be in a world already

#

Basically I would need some kind of cloning support

#

And then a setLocation on BlockState and an addToWorld on Entity

#

Because the entity system is like

#

12 years old

undone axleBOT
young knoll
#

Yeah there is

#

It's no problem with NMS but yknow

#

NMS

#

Would need a proper system for handling virtual entities

#

Which we have discussed but nothing has come of it yet

#

Entities that aren't in a world

#

It just exists

#

It gets added to a world separately

ancient plank
#

I just exist

young knoll
#

Kind of

#

But it provides no access to the entity specific methods

ancient plank
#

smell

young knoll
#

The main thing we discussed is having a isVirtual method

#

and then an addToWorld method

ancient plank
#

like coconuts

young knoll
#

Just remake bukkit

ancient plank
#

what would this new ecosystem be named

thin iris
#

in the club w my twin we be vibin

timid hedge
#

I got a problem and that is i have Citizens on my server and i also use it as a depency in one of my plugins and when the server loads i get a error message that Citizens is already initialized. How do i prevent this?