#help-development

1 messages · Page 1114 of 1

undone axleBOT
echo basalt
#

fuck it

hybrid turret
#

oh yeah

#

ServerPlayer

#

thanks

#

okay i think i got the naming

#

yay

#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
__**Admin:**__

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

names Show previous usernames, global display names, and server...
userinfo Show information about a member.

__**ModLog:**__

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

__**Permissions:**__

permissions Command permission management tools.

hybrid turret
#

well no custom commands shown here ig lol

echo basalt
#

?uptime

undone axleBOT
#

I have been up for: 18 days, 9 hours, 50 minutes, 12 seconds (since <t:1723067352:f>)

hybrid turret
#

damn bro should get some sleep, up for 18 days

echo basalt
#

almost as much as me

hybrid turret
#

damn illusion 😔 think about ur health

#

the guide sets the location for the npc in the first code block. i can't really find any method in the ServerPlayer class for that, wtf

blazing ocean
hybrid turret
#

thanks rad

hybrid turret
#

u got the names for the packets and stuff u used somewhere bc just trial and error is a bit depressing and i feel like not very efficient lmao

pliant topaz
#

just enter the packet name and it gives you the new name for the version you want

sterile breach
hybrid turret
#

oh aight imma give it a watch

hybrid turret
#

could i keep a chunk loaded by placing an npc in it?

smoky anchor
#

Probably not, but you can use plugin chunk tickets

hybrid turret
#

oh interesting

#

so when would this ticket have to be added? once and it's loaded forever?

#

(until the ticket is removed)

smoky anchor
#

That is how I assume it works, never used them.
Not sure how they persist over restarts btw.

hybrid turret
#

yeah that's not gonna be a problem

#

it's jut for a small private server so i'll just create a hashmap and either gson it or just store it via yaml

#

probably with coordinates or something

#

for getting the chunk

#

(just theory, no idea if that's how it works)

smoky oak
#

tryina remember... does spigot have some inbuilt database manipulation?

sullen marlin
#

no, just java

orchid trout
#

why is yaw -180 to 180 and not just 0 to 360

sullen marlin
#

mafs

#

In computing and mathematics, the function atan2 is the 2-argument arctangent. By definition,

    θ
    =
    atan2
    ⁡
    (
    y
    ,
    x
    )
  

{\displaystyle \theta =\operatorname {atan2} (y,x)}

is the angle measure (in radians, with

    −
  ...
orchid trout
#

intimidating

pure dagger
#

hi, does anyone know?

sullen marlin
pure dagger
#

like check this every second and if its not anymle then cancel the effect? or how

rotund ravine
#

What does the event say on the javadoc

#

?jd-s

undone axleBOT
rotund ravine
#

Pretty clear here tbf

#

If that works for it

pure dagger
#

i mean, when the Player ffor exsmple goes far the hook breaks and no thing gets called i testex it

#

sorry im typing from my Phone

rotund ravine
#

Well you can always just have a task follow it after the caught event

young knoll
#

Does the event get called when the line breaks?

#

Maybe with the reel in state?

pure dagger
#

i mean i tested it that every time the event would be called it would msg me the state

#

it didnt in many cases

ebon hawk
#

hi
How do I add the Check for Updates feature in my plugin?

kindred quest
#

How To Remove Death Animation & Particles ?

smoky anchor
chrome beacon
#

Might break other plugins that depend on the entity death event

copper spade
#

I assume the answer is no but is there ANY hacky way to achieve the

void setCooldown(@NotNull
Material material,
int ticks)

On different items but use the same material under the hood.

chrome beacon
#

no

copper spade
#

urgh. Thanks anyway.

#

I guess you could do it through durability?

chrome beacon
#

if you have a resource pack

copper spade
#

I do.

chrome beacon
#

Then yeah custom model data

smoky anchor
smoky anchor
chrome beacon
#

That's not supported and might break other plugins even more since the player isn't in the right state

slender elbow
#

cooldown groups 🙏

haughty pewter
#

Is it possible to remove the upgrade text, when the trim still put on

hybrid turret
#

I ran remapped buildtools for latest but i maven won't let me input the correct version in the dependency in the pom.xml

#

could there be any other reason?

chrome beacon
#

Did you reload your pom

hybrid turret
#

yes

chrome beacon
#

Send your pom and the error message

#

?paste

undone axleBOT
hybrid turret
#

hold on

#

wtf

#

it seems to work now lol

#

what the ffffffff

#

i did nothing else

chrome beacon
#

I take it you forgot to reload the pom

hybrid turret
#

i mean i clicked the reload button IJ showed me every time

#

now i manually clicked the reload button in the maven tab and it worked

#

are they different?

chrome beacon
#

no

hybrid turret
#

weird

torn shuttle
#

how can I collaborate with someone on spigot to work on the formatting of a resource page?

#

any ideas?

worldly ingot
#

I can format your resource out of existence

#

If that's of any help

wanton locust
wanton locust
worldly ingot
#

#help-server in the future, but this seems like an issue you should be sending to ItemsAdder as it's a bug in their plugin

torn shuttle
#

I'll shank ye

worldly ingot
#

I'll hammer ye

torn shuttle
#

I'll give you the good ol' 1-2

worldly ingot
hybrid turret
#

uh oh dev fight

eternal night
#

1-2 hugs*

hybrid turret
#

lemme get my camera

torn shuttle
#

🔪

worldly ingot
#

I like lynx better

hybrid turret
#

🎥 yup go now

torn shuttle
#

WORLDSTAAAR 👊

hybrid turret
#

can i somehow get the playtime of a player on the server?

hybrid turret
#

oh

#

thanks

mint siren
#

would anybody here be aible to help me with nms custom entity registration(spigot 1.12.2) . I am not familiar with this and I tried just copying some code from people but It ended up not really working. What I want to do is make a custom nms armorstand entity that will stay even after the server restarts

chrome beacon
#

You will need to remove the entity on chunk unload

#

and the spawn it again on load

#

Do not try to inject your entity to a registry

smoky anchor
chrome beacon
#

until the client can't join

mint siren
chrome beacon
chrome beacon
#

since it doesn't know what your entity is

smoky anchor
#

Edit the packet to change the entity id /j

mint siren
#

I don't really understand to be honest. If I use your method will I need to manually resummon all the entities in my plugin somewhere?

little mortar
#

If I want to disable the default behaviour of an event until the user does something and then enable it back, how can i reach that?

slate scroll
#

Anyone know how to give yourself a random effect?

#

./effect @s <how do I make this random?>

chrome beacon
chrome beacon
#

you save and resummon the entities on your own

chrome beacon
#

that checks if your event is enabled for your player

little mortar
#

how to re enable?

#

I did event.setCancelled(true)

chrome beacon
#

???

#

You store somewhere (like a Set) if the player has it enabled or not and then only cancel the event if it isn't

little mortar
#

Ok, thanks bro

visual tide
vague swallow
#

Hello dear people, can someone help me please? This code is supposed to update a sign at a specific location. I made sure that there was a sign at the given location but it's not updating fsr. Does anyone have an idea? It's on 1.12.2

        Bukkit.broadcastMessage("ERROR");
        Block block = loc.getBlock();
        if(block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) {
            Sign sign = (Sign) block.getState();
            sign.setLine(0, "§4§l[ERROR]");
            sign.update(true);
            Bukkit.broadcastMessage("debug1.");
        } else {
            Bukkit.broadcastMessage("debug2");
        }
    }``` The message "debug1" was broadcasted but the sign didn't update
mint siren
#

but it didnt work maybe because it was 1.12.2 but idk

#

I kept getting like skipped entity or something when enabling the server

hybrid turret
#

i'm trying to display the player's playtime on the sidebar scoreboard but it doesn't even show up. am i missing something?

  private void registerScoreboardPlaytime() {
    ScoreboardManager manager = Bukkit.getScoreboardManager();

    assert manager != null : "Scoreboard manager is null";

    Scoreboard scoreboard = manager.getNewScoreboard();

    Objective objective = scoreboard.registerNewObjective("playtime", Criteria.statistic(Statistic.PLAY_ONE_MINUTE), "Playtime");

    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName("Playtime");

    Bukkit.getScheduler().runTaskTimer(this, task -> {
      List<Player> players = new ArrayList<>(Bukkit.getOnlinePlayers());
      players.forEach(player -> {
        Score score = objective.getScore(player);
        score.setScore(player.getStatistic(Statistic.PLAY_ONE_MINUTE));
        player.sendMessage("Your Statistic has been updated.");
      });
    }, 0, 60 * 20);
  }
#

No errors

mint siren
#

I don't see any player.setscoreboard method being called?

visual tide
hybrid turret
#

oh

#

oops

#

thanks @mint siren

mint siren
#

hope that fixed it lol otherwise Idk im not that experienced

umbral ridge
#

😿

chrome beacon
haughty pewter
#

oh i just set trim show_in_tooltip:false

white raptor
#

Apparently I can't change the content of a cartography table that was opened with code?

for instance, the following code is not working:

Inventory gui = Bukkit.createInventory(player, InventoryType.CARTOGRAPHY); // Setting the owner as null doesn't have any effect.

player.openInventory(gui);

gui.setItem(0, new ItemStack(Material.STONE)); // This is the line that is not working

However, it does work with other types of inventories such as BREWING and it also works when the player opens the cartography menu manually. Am I doing something wrong?

chrome beacon
#

Make sure Spigot is up to date

white raptor
#

I used the latest stable version from the buildtools: 1.21.1-R0.1-SNAPSHOT (Exact same version as in the pom dependency)

grim hound
#

it needs to be the base64 encoded texture property

slate siren
#

Hey guys.! Im working on a sustem but i need some help.

System Description:

This system tracks the damage taken and the remaining hearts of players in Minecraft. It records each player's starting heart count (defaulting to 10 hearts) and monitors the damage they receive. When a player takes damage, their remaining hearts are updated, and the total damage taken is tracked. Upon a player's death, the system calculates the difference between their starting hearts and their remaining hearts to determine how many hearts were lost. This amount is then reported to the killer, indicating how many hearts they effectively took. Additionally, the system can also show the remaining hearts of the deceased player.
https://pastes.dev/23x2Eut85m

chrome beacon
#

so make sure it's up to date

#

run /version

grim hound
#

I was wrong

chrome beacon
#

The textures id

#

It's unique

slate siren
# slate siren Hey guys.! Im working on a sustem but i need some help. **System Description:**...

The problem is, when one player kills another player,

Shows the remaining hearts of the player who killed the deceased. This is correct.

However, I cannot determine how many hearts the killer took from the player he killed. For example, more than one player can attack a player. The last person to kill will send a message to the person who dealt the final blow, and I want this person to keep track of how many total heart rates the dead person took and report it to the killer.
Could you help me with this?

white raptor
# chrome beacon run /version
[19:01:17 INFO]: This server is running CraftBukkit version 4300-Spigot-a759b62-7070de8 (MC: 1.21.1) (Implementing API version 1.21.1-R0.1-SNAPSHOT)
[19:01:17 INFO]: You are running the latest version
chrome beacon
#

?jira

undone axleBOT
white raptor
#

will do. Thank you

grim hound
#

uh

#

mfnalex

#

help

#

isbroken

#

got this from you

#

however, when a guy custom made a head and sent it's base64 to me, this happened

grim hound
chrome beacon
#

wait why are you using reflection to access those methods

grim hound
#

do not ask questions xD

#

intellij getting real confused

chrome beacon
#

At least use a MethodHandle

grim hound
wraith delta
#

Which ItemFlag hides this text?

grim hound
chrome beacon
grim hound
#

anyway, does anybody know how I can change the title of a gui?

chrome beacon
#

I assume you mean after it's been created

grim hound
#

wait, there's a method for that?

chrome beacon
#

yes

grim hound
#

I just closed and reopened the gui

grim hound
chrome beacon
#

I don't remember

grim hound
#

like 1.8+?

chrome beacon
#

not that far

#

1.19 maybe

grim hound
#

bruh

#

I'm still doing this 100% as packets

#

but bruh

wraith delta
grim hound
#

but doesn't close the gui

#

just reopens it

#

nice

wraith delta
slender elbow
#

you need to add attribute modifiers to use the hide attribute modifiers flag

wraith delta
slender elbow
#

like attribute modifiers

wraith delta
#

just add a random one?

slender elbow
#

like the ones shown in your screenshot, but the flag doesn't work if the ItemMeta doesn't have any directly set

slender elbow
#

do you want to keep the default ones or is it just for a gui item?

wraith delta
#

it works for hiding the armor trim, just not the attributes

wraith delta
#

thats enchanted and stuff

slender elbow
#

then if you don't care about the attribute and its values you can just add any random modified

wraith delta
#

.addAttributeModifier(Attribute.GENERIC_ARMOR, null); can use this even if its not a armor?

slender elbow
#

well, you need to add an actual AttributeModifier

#

not null lol

ebon hawk
#

hi
How do I make the plugin file inside the server update automatically after updating the plugin .jar file?

slender elbow
#

and yes you can add for any attribute kind

chrome beacon
# ebon hawk hi How do I make the plugin file inside the server update automatically after u...

If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...

wraith delta
rugged fern
#

Can I somehow create custom items, food, weapons, armor with spigot?

eternal oxide
#

what do you mean by "custom"?

#

different stats or looks?

rugged fern
#

Both

eternal oxide
#

Stats, yes.

#

Looks, yes with a resource pack

rugged fern
#

Looks just with customModelData right?

eternal oxide
#

yes

#

Minecraft needs to add streaming of resources via PMC

rugged fern
#

Alright uhm could u give me an example on what i can do? Like would a CustomFood Item or Armor work?

rugged fern
eternal oxide
#

just my wish

#

you just need to google custom model data

#

examples

#

theres plenty

rugged fern
#

Can i modify the strenght or protection of an item directly? And the data of how much saturation will be restored?

rugged fern
#

How do i use the food component?

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
__**Admin:**__

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

names Show previous usernames, global display names, and server...
userinfo Show information about a member.

__**ModLog:**__

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

__**Permissions:**__

permissions Command permission management tools.

vague swallow
#

Does anyone else has an idea on that one?

eternal oxide
#

no

#

every call to getState fetches a NEW state

#

you keep the state, modify it, then call state.update()

vague swallow
#

Ho do I do that? This was my code:

        Bukkit.broadcastMessage("ERROR");
        Block block = loc.getBlock();
        if(block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) {
            Sign sign = (Sign) block.getState();
            sign.setLine(0, "§4§l[ERROR]");
            sign.update(true);
            Bukkit.broadcastMessage("debug1.");
        } else {
            Bukkit.broadcastMessage("debug2");
        }
    }```
#

instead of sign I just put block.getState() ?

chrome beacon
#

no

#

What you've done is correct

vague swallow
chrome beacon
#

Do you have something else overriding the sign

eternal oxide
#

code is correct, but clearly you are on old version as signs have a side now

chrome beacon
#

That too ^^

vague swallow
#

1.12.2

umbral ridge
#

1.12.2 😿😿😿

vague swallow
#

Does noone have an idea? There must be a way! Is it allowed to @ the helpers?

eternal oxide
#

the code you posted is correct. you are doing somethign wrong elsewhere

sleek creek
#

Is it some kind of event? have you registered the Event/Command?

pure dagger
#

how to remove only 1 item from itemstack?

#

is there 1 method?

paper viper
#

Decrease the count by 1, if the count is 0 then remove

pure dagger
#

umm wait.. inventory click event only returns main hand

paper viper
#

If the count is 0 set main hand to null

#

To remove the stack

#

You have to give us some more context

#

Are you decompiling a plugin JAR?

#

And trying to edit the source code?

#

Are you allowed to decompile it

#

And edit the code

pure dagger
#

does null means just AIR?

#

bruh

#

i forgot that soups are unstackable LOOOL

#

can i just do this to check if either left or right hand is the item ? its InventoryClickEvent

ItemStack item = event.getCurrentItem();
ItemStack item2 = player.getInventory().getItemInOffHand();```
raw root
#

Hiring Builder

graceful patrol
#

yo, im kinda new at java, I want to access a variable from a class that is different than the class where the variable is specified, how do I do that?

eternal oxide
#

?di

undone axleBOT
chrome beacon
undone axleBOT
coarse linden
#

¯_(ツ)_/¯

eternal oxide
#

yes it does, thats its whole purpose

coarse linden
#

di for a beginner?

#

really?

#

you dont even know what this variable does

#

or is

#

doesn't seem like actual help

eternal oxide
#

If you are unable to understand it their Java knowledge is lacking and needs further study.

coarse linden
#

just a referal at beast

coarse linden
eternal oxide
#

its a complete tutorial about dependency injection

coarse linden
#

all im saying is

#

you're assuming

#

like crazy

eternal oxide
#

why? the link does everything. We have that link because everyone has explained it a million times already

#

No assumptions, you want me to copy paste the contents of that link everytime someone asks?

coarse linden
#

if its just suppose to be const use static.

#

if you want to use it like for operations or whatever, you can make a static method for that class and call that method in your class with the variable

#

to be clear you shouldn't do this alot, and should use a singleton/di/whatever to access that class and get the variable from it

eternal oxide
#

God no, don;t start throwing static at new devs

coarse linden
#

how will they learn?

#

just give them all the info and dont let them make mistakes?

#

i've told them what they should do instead, but for their case use static

#

let them experience learning

eternal oxide
#

by learning di. Static has a very specific purpose with many downsides.

graceful patrol
#

guys, im not that bad at java, i understand docs lol

#

but thx

coarse linden
#

but if you throw everythign that is bad and good at them they can't learn

coarse linden
#

static also isn't bad

#

its just the uses of public static

#

that are bad

eternal oxide
#

teach best practices and they will leanr static when its actually needed

nova notch
coarse linden
#

should have gave them a video sorry bananarobot

#

i should just like refer them to somewhere else

#

and not actually help them

eternal oxide
#

or... you know use the resources that are provided in this channel. like ?di

coarse linden
#

i dont think they need di

#

for something that simple

#

not saying use static

eternal oxide
#

it was literally what he asked for

coarse linden
#

?????

#

i dont think he said "i need di"

#

😹

eternal oxide
#

you went off on a crazy rant about not helpign and he shoudl just use static

coarse linden
#

yes

#

for beginner

nova notch
#

stop arguing already this man already solved it 😭

coarse linden
#

but then he said he wasn't really

eternal oxide
#

for a beginner learn di

coarse linden
#

horrible

#

thats like saying for ur first language learn c++/asm

eternal oxide
#

di is one of the MOST basic java principles a beginner needs to learn

coarse linden
#

not the best of choices

graceful patrol
eternal oxide
#

I can;t argue with an idiot. not possible to win

coarse linden
#

lmao

#

the most basic is literally a singleton

eternal oxide
#

ask any seasoned dev in here

coarse linden
#

singleton is the most basic

#

ever seen a di singleton?

#

probably not

lost matrix
#

You start with di and go over to singleton patterns when you understood the drawbacks of this pattern.
Di forces you to write more robust code. Singletons can quickly crash your applications when they get more complex
and things like circular dependencies become an issue.

warm mica
# coarse linden di for a beginner?

I would agree if we would be talking about spring's di. But the tutorial he gave is basically only about passing objects within constructors and avoiding static, which is one of the most trivial things in java. Although the wiki page indeed can be overwhelming for newcomers

hazy parrot
#

Di is one of the first things you learn about oop

eternal oxide
#

You listen to them just the same as you do for any Bukkit event. Just ensure any code you call from the Listener is thread safe

lost matrix
#

Add the word Async to your events name as a hint

raw root
#

hiring builder

eternal oxide
#

?services

undone axleBOT
chrome beacon
#

If you're making your own event use the constructor that takes a boolean and pass true to indicate an async event

dawn flower
#

how do i get a nullable integer from config?

eternal oxide
#

use Integer not int

#

it will auto box

#

Thats called learning 😄

silk venture
#

what is wrong with this code? I cant make it work
btw the minecraft version is 1.19 and the plugin is conditional events

chrome beacon
silk venture
#

alr sorry

#

and thnk

eternal oxide
#

why argue with the answers you get?

#

ALL events in raised by Bukkit are sync or async. internal and custom. you listen to them all exactly the same. The ONLY difference is you have to be aware aof thread safety when async.

#

It is an Event registered with Bukkit and listened to in teh EXACT same manner

torn shuttle
#

sanity check, better to have a task manager that checks 100k entities than 100k standalone tasks right

eternal oxide
#

yes

torn shuttle
#

ok

#

I did do an oopsie

eternal oxide
#

you cna even distribute teh load, but still one task is better

torn shuttle
#

though in my defense it is using a shockingly small amount of power

lost matrix
#

Show your pom

torn shuttle
#

got something to run 81 million times in 1 hour

#

big pog

#

on an empty server no less

tardy delta
#

dont modify an immutable collection

grim ice
eternal oxide
#

immutable = can not make changes

grim ice
#

elgar's advice is better

lost matrix
#

No this is a basic issue of trying to mutate an immutable collection

eternal oxide
#

Without reading your code in detail, the List returned by LiteBans is probably immutable. you need to use their API to add a ban

quiet ice
#

use recaf

#

although, you can't create new classes on there last time I checked.

#

Uh, in that case you would need a proper decompiler and the proper tooling around it

quaint mantle
#

I need to shadow my plugin with gradle, there is any guide or something?

dawn flower
#

how do i parse &#rrggbb chatcolor

eternal oxide
#

Spigot has rgb support

#

its in teh md_5 ChatColor

azure zealot
young knoll
#

It won’t parse that format though

#

You can find code on the forums that will however

wraith delta
# dawn flower how do i parse ``&#rrggbb`` chatcolor
public static String hex(String message) {
Pattern pattern = Pattern.compile("(#[a-fA-F0-9]{6})");
Matcher matcher = pattern.matcher(message);
while (matcher.find()) {
    String hexCode = message.substring(matcher.start(), matcher.end());
    String replaceSharp = hexCode.replace('#', 'x');

    char[] ch = replaceSharp.toCharArray();
    StringBuilder builder = new StringBuilder("");
    for (char c : ch) {
         builder.append("&" + c);
    }

     message = message.replace(hexCode, builder.toString());
     matcher = pattern.matcher(message);
  }
  return ChatColor.translateAlternateColorCodes('&', message).replace('&', '§');
}
```Usage: hex("&#rrggbb Text");
dawn flower
#

does Inventory#getHolder return a clone of the holder?

blazing ocean
wraith delta
blazing ocean
wraith delta
carmine mica
#

w/static imports, its even better. text("hi", color(0xffffff))

blazing ocean
#

everything else is a spigot issue

young knoll
#

Nothing a little NMS can’t fix

wraith delta
#

I was recently working on a GUI, you had me think for a bit about the line you gave but I think while that might be awesome for basic return messages I use the function I sent for very universal use. I do not want to add NMS, it is best to avoid that so when updating the server you don’t need to make edits

blazing ocean
#

paper:

#

getting banned now ggs

wraith delta
#

I definitely would never use the paper api. As for the server, I don’t find it to be much different except a few minor settings I do need

paper viper
#

ok

paper viper
#

adventure also isnt paper api

#

its a separate text framework that paper does incorporate but can be also used on other bvukkit software too

wraith delta
#

I don’t believe there’s an issue here, you guys especially rad just want to start an argument. No one responded to the user, I gave a legitimate working method. Maybe it’s not perfect, but it will work anywhere which is important.

quaint mantle
#

gui's suck

wraith aurora
eternal oxide
#

GUIs as its an acronym

grim ice
#

unless you're using them in chat

#

genuinely can't be bothered to use them

young knoll
#

Mfw translation components

grim ice
#

if you can't understand English in 2024

#

it's your problem

#

unless you mean keybind stuff

young knoll
#

Both

grim ice
#

keybinds make sense

#

that's a very specific and rare use case though

slender elbow
#

bro hates accessibility

#

also fonts 🗿

young knoll
#

Yeah fonts are huge

slender elbow
#

actually they're quite small

young knoll
#

Not if you mess with the character size

#

I should get to work on that library to host a resource pack through the server port

umbral flint
worldly ingot
#

also click/hover events

echo basalt
#

mfw bedrock supports translatable components but not rgb

#

also scoreboards truncate after 16 chars

young knoll
#

Bedrock moment

round finch
#

Bedrock is getting all the cool features

#

But... Just worse then java

Imagine dying from lag on your single player world

echo basalt
#

json ui kinda goated tho

round finch
grim ice
#

in most cases

young knoll
#

Well if choco gets that PR merged

worldly ingot
#

I've been busy :(

young knoll
#

He hasn’t even been busy giving me op on hypixel

#

Shameful

worldly ingot
#

I've actually been busy writing an auto ban

#

For you specifically

echo basalt
#

make sure it's written in Go because hypixel loves writing solutions in janky languages

#

What percentage of the codebase is in kotlin 🤔

worldly ingot
#

0% that I'm aware of at least

echo basalt
#

I remember the public SWM test plugin was made in kotlin

worldly ingot
#

Was it like official official though or was it just a MK project? lol

echo basalt
#

I believe it just encoded and decoded regions

#

somewhat official

#

can you tell them to actually look at my applications :3 I know I fucked up but like it's been 3 years or wtv

#

fork the server and reimpl it yourself

#

ezpz

slender elbow
#

create new world with same seed
copy chunk

worldly ingot
#

300iq

echo basalt
#

create the world on a dedicated world-creation server to not lag

#

send the files over UDP ClownDistorted for less latency

#

make sure to do it async because async = performance

#

I should start charging my hourly rate async so I get more work done at the same time

#

mess with NMS and recreate the old logic

slender elbow
#

what does automated even mean

echo basalt
slender elbow
#

it's what worldedit does for //regen

young knoll
#

I was gonna make that joke

worldly ingot
#

Well the reason is that it doesn't work anymore because the world-gen code has changed so much over the years

young knoll
carmine mica
#

You asked the same thing in the paper discord yesterday, and got the same answer

worldly ingot
#

Sure, the behaviour probably worked relatively well enough. But with 1.14 (the version where that exception started being thrown), the change was significant enough to where the effort wasn't really warranted

carmine mica
#

Create a copy of the world and copy chunks over

worldly ingot
#

^ it's not a bad alternative solution

carmine mica
#

All possible with the API

worldly ingot
#

In fact, you may get better results this way

carmine mica
#

You will get 100% accurate results

ancient plank
#

I concur

carmine mica
#

Assuming there’s no bugs with the deterministic generation based on seeds

worldly ingot
#

Or a plugin doing something stupid in world gen

carmine mica
#

Both of which would also impact any regenChunk method

ancient plank
#

server I work with, we have a backup of the world and use that to make worldedit //regen work off of that backup when there are chunk corruptions

viscid carbon
#

Anyone here use a live server with intelij? looks neat

slender elbow
#

I have never had issues with //regen it just sounds like your seeds are messed up

worldly ingot
#

I told you the reason 😅

slender elbow
#

because it was too much work to maintain

#

I wouldn't say it's "no reason"

worldly ingot
#

By all means, if you can figure out a way to reimplement it in 1.21 with modern world generation internals, we welcome a PR to reimplement that method

umbral flint
#

How should I organize my test configurations? This is what I currently have: https://imgur.com/t5KTLLz

The configuration is properties.properties, which won't be shared in the remote repository
properties_template.properties is as the name explains, the template

quaint mantle
smoky anchor
#

ChatColor.stripColor maybe ?

echo basalt
#

serialize with the legacy component serializer and then strip

#

ezpz

#

use legacyAmpersand

#

(maybe?)

#

Just print stuff out

agile anvil
#

What kind of itemmeta is this? The docs don't have ItemMeta#displayName but ItemMeta#getDisplayName

#

we cannot provide you some help with this :/

hybrid turret
#

?paperdev

undone axleBOT
#

Make sure to ask in the appropriate server concerning development towards different JAR types such as PaperMC. (Tip: Google them!)

hybrid turret
#

that's the command

#

also

#

?whereami

lost matrix
#

What do you need the unformatted component for? There is almost no use case for this.

hybrid turret
#

is it possible to interact with npcs without using ProtocolLib?
well ig it probably is, but how... much more work would that be?

lost matrix
#

Add the name as metadata via the PDC of the ItemStack instead.
Or even better: Write a proper GUI implementation that doesnt need any data from the clicked ItemStack.
Reading from a clicked ItemStack in the InventoryClickEvent is a dirty fragile hack.

#

But a quick fix: Add a PDC tag with the Players UUID or Name.

hybrid turret
#

what's wrong with storing the player's uuid in pdc?

lost matrix
#

You are relying on UI data. You should strictly separate the clean data used for logic and the user interface representation.
When writing a website, you wouldnt do checks like if(button.text == "Next"), but rather properly attach an action
to the button object in memory.

#

The logic needs to be completely separated from the visual representation.

hybrid turret
#

ic, how would that look tho? like... how would you know which player to choose with the logic not bound to the UI?

hybrid turret
#

i'm using ur gui tutorial... am i doing something wrong then?

#

lol

#

i mean obviously, but i don't see how that tutorial teaches that

#

(or i missed it)

lost matrix
#

Ill write you an example based on the tutorial

hybrid turret
#

that would be mint thank you

#

i'm on the road to get my code as clean as possible and stuff like this helps a ton (idk why but i learn a lot from more-or-less-spoonfeeding lol)

lost matrix
# hybrid turret that would be mint thank you
public void decorate(Player player) {
  Bukkit.getOnlinePlayer().forEach(online -> {
    InventoryButton selectionButton = createSelection(online.getUniqueId());
    addButton(selectionButton));
  });
}

public InventoryButton createSelection(UUID targetPlayerId) {
  return new InventoryButton()
      .creator(player -> createPlayerHead(targetPlayerId))
      .consumer(event -> {
        Player clicker = (Player) event.getWhoClicked();
        Player selected = Bukkit.getPlayer(targetPlayerId);
        if(selected == null) {
          clicker.sendMessage("This player is no longer online.")
          return;
        }
        // Do your selection logic here
        selected.sendMessage("You have been clicked by " + clicker.getName());
      });
}

private ItemStack createPlayerHead(UUID playerId) {
  ...
}
hybrid turret
#

ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

omg i'm stupid apparently

#

thank you sm

lost matrix
#

👍 .

lost matrix
# hybrid turret oh right also this ^

In Spigot its not. The server discards interaction packets for unkown Entities. Paper has an PlayerUseUnknownEntityEvent.
In general you would have to either use NMS or ProtocolLib to listen for incoming packets.

hybrid turret
#

Yeah with NMS instead of ProtocolLib I mean

#

oops

shadow night
#

What about packetevents

lost matrix
#

Thats possible, but quite complicated. You basically have to inject a packet handler into the netty pipeline.
Its probably best to reuse someone elses code for this. Im still trying to refine my packet handler and its only almost there.

#

Im doing some fked up shenanigans with a queue for multithreaded packet handling

#

This allows me to have multithreaded, per-player instanced entities

hybrid turret
#

woah

#

uhm

#

welp

#

ig either NOT add npcs to my plugin or give in to protocollib lmao

lost matrix
#

Hmm. I have a gist for a trivial implementation. Let me check if it still exists.

shadow night
#

have y'all heard about packetevents

hybrid turret
#

i thought packetevents were a protocollib thing

shadow night
#

That's its own library

lost matrix
#

Packetevents is a plugin which listens for pretty much all packets and fires bukkit events for them

hybrid turret
#

ahh

#

well at that point i might as well drop nms and use protocollib

lost matrix
#

Well, just read up. Not exactly spigot events, but something similar.

lost matrix
hybrid turret
#

eventually

lost matrix
#

In that case ProtocolLib is probably the way to go.
For a server impl i would have given out the packet listener. But ProtocolLib is basically on every
server using public plugins.

hybrid turret
#

i see okay, guess i'll take a look at that then.

ProtocolLib also makes spawning npcs and such a lot easier i suppose?

#

or in other words

#

can NMS be fully replaced by ProtocolLib?

lost matrix
#

Yes, ProtocolLib just lets you build the same packets as NMS.
With different methods that can be quite cumbersome sometimes.

hybrid turret
#

cumbersome?

#

in what way

lost matrix
#

Stuff like this for example

slate siren
#

When a player kills someone, how can I keep track of how many hearts they took and how many HP they took when they killed someone?

For example, a player has 10 hearts. 10 hearts and 20hp

Now let's say a player falls from a height, 2 hearts are lost and 8 are left. If someone kills this player at that moment, they will kill him with 8 hearts.

You killed (player) with 8.0 hearts ❤️ remaining

A message in style

#

I tried to do it but I couldn't do it

hybrid turret
#

PlayerDamageEvent

#

wait

#

no

#

i think i misunderstood

lost matrix
#

Yeah PlayerDamageEvent and then gather the data you need and store it in a Map or something like that.

hybrid turret
#

why a map? isnt all the data provided by the event? and when the hit entity's hp goes below 0, send the message?

lost matrix
#

He wants to check who did the most damage on a target so they can reward the kill to the player with the most damage done.

slate siren
#

https://pastes.dev/23x2Eut85m

I did it but it says 10.0 hearts every time. For example, the player was damaged by someone else, and someone else killed him. I think it counts all the damage as being done to the person who killed him

hybrid turret
#

ahhhhhhhhhhhh

lost matrix
lost matrix
#

Then this class logically makes no sense

smoky anchor
#

Do not store Player, use UUID instead.

lost matrix
# slate siren No

You need to track who did the most damage to who.
So more like a

Map<UUID, Map<UUID, Double>>
slate siren
slate siren
lost matrix
#

The result will be me getting a stroke trying to understand what this is supposed to mean...

agile anvil
#

I'm not sure they even understood what they want sadly

agile anvil
#

I think they want to register the whole record of who damaged how much on a given player, and then find out the one who dealed the most

smoky anchor
lost matrix
slate siren
#

Multiple players can attack a player. A player has Max 20hp, it doesn't matter which one does the most damage.

What matters is how much HP the killer used to kill.

smoky anchor
#

You can not get the HP of the victim in the death event ?

slate siren
#

I'm at school, they collect phones

#

Damn

#

...

lost matrix
#

You dont need to track that. The EntityDamageByEntityEvent already covers that for you.
No need for any Maps

hybrid turret
hybrid turret
#

this is an OR question

#

not a yes no question

agile anvil
#

I think I got it

#

He wants to know how many HP in total the killer dealed to the player

lost matrix
# slate siren Exactly

Here. This will track how much damage the last (killing) blow was

  @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
  public void onDamage(EntityDamageByEntityEvent event) {
    Entity defender = event.getEntity();
    Entity attacker = event.getDamager();
    if (!(defender instanceof Player) || !(attacker instanceof Player)) {
      return;
    }
    Player defenderPlayer = (Player) defender;
    Player attackerPlayer = (Player) attacker;

    double damageDone = event.getFinalDamage();
    double healthLeft = defenderPlayer.getHealth();

    boolean isKillingBlow = healthLeft <= damageDone;

    if (isKillingBlow) {
      UUID attackerId = attackerPlayer.getUniqueId();
      UUID defenderId = defenderPlayer.getUniqueId();
      System.out.println(attackerId + " killed " + defenderId + " with " + damageDone + " damage.");
    }
  }

No need for Maps here

smoky anchor
#

You still gotta store something if they want to change the death message.

lost matrix
#

Sure, was that something he wanted?

smoky anchor
#

Oh no sorry, I mistead the code

lost matrix
#

Ah i should have read the entire code lol

#

Hmm, does SinHa just want to write a plugin which lets you steal max health from other players?
Or one that just halves your max health on every death?

quaint mantle
#

Ciao cerco qualcuno italiano

lost matrix
#

English is the official language on this discord 🙂

smoky oak
#

alternative answer: i understood not a single word there, sorry :/

lost matrix
#

Something something hello, is there someone italian

#

Or similar. idk what "qualcuno" means

smoky oak
#

ask gpt4 lol

lost matrix
#

I could also just not care enough. Thtat what i decided to do initially.

smoky oak
#

fair

pliant topaz
#

'Hi I am looking for someone Italian' (said google)

tardy delta
#

so google said you are looking for an italian?

pliant topaz
#

not me, i just translated it

hybrid trellis
#
static public void cloneWorld(String originalWorldName, String newWorldName) throws IOException {
        Path path = Paths.get(System.getProperty("user.dir") + File.separator + "worlds" + File.separator + originalWorldName);
        Path newPath = Paths.get(System.getProperty("user.dir") + File.separator + "worlds" + File.separator + newWorldName);
        Files.copy(path, newPath, StandardCopyOption.REPLACE_EXISTING);
    }
```I'm trying to clone worlds but the resulting folder is empty?
smoky oak
#

you might not be able to copy any currently open files. do you get any error?

hybrid trellis
#

No

#

And isn't only the session lock open

tardy delta
#

why hardcode path into your home folder

hybrid trellis
#

Wait you got a point

lost matrix
#

Files.copy doesnt recursivley copy directories. You need to walk the file tree for that.

tall dragon
hybrid trellis
tall dragon
#

look into Files.walk

dawn valley
#

can anyone help me out with my snipset here:
https://mclo.gs/WEwI5t0

i am trying to cancel itemadder drops from block even they are set in itemadder config with this code if canceliadrops is set to true in my config
but its not working for some reason
i litterally been trying eveything

#

maybe @wise rock can help out ? as there is not api help channel in itemadder

lost matrix
# hybrid trellis Help pls
  public static void cloneWorld(String originalWorldName, String newWorldName) throws IOException {
    Path sourcePath = Paths.get(System.getProperty("user.dir"), "worlds", originalWorldName);
    Path targetPath = Paths.get(System.getProperty("user.dir"), "worlds", newWorldName);
    if (!Files.exists(targetPath)) {
      Files.createDirectories(targetPath);
    }
    try (Stream<Path> paths = Files.walk(sourcePath)) {
      paths.forEach(source -> {
        try {
          Path target = targetPath.resolve(sourcePath.relativize(source));
          if (Files.isDirectory(source)) {
            if (!Files.exists(target)) {
              Files.createDirectories(target);
            }
          } else {
            Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING);
          }
        } catch (IOException e) {
          e.printStackTrace(System.out);
        }
      });
    }
  }

Also, wtheck is Paths.get(System.getProperty("user.dir"), "worlds", originalWorldName); this supposed to be?
Just pass it through as a method parameter.

quaint mantle
#

hey gamers.

so ive generated an empty void world, but upon reloading it seems like the emptychunkgenerator i made doesn't exist anymore and it reverts back to generating the remainder of the world normally. any idea how to fix this?

lost matrix
quaint mantle
#

my bad

#

xD

lost matrix
#

How are you attaching the chunk generator to your world?

quaint mantle
#
        if(worldExists(world) == null) {
            WorldCreator wc = new WorldCreator(world);
            wc.generator(new EmptyChunkGenerator());
            World w = wc.createWorld();
            w.save();
            return w;
        } else {
            return null;
        }
    }```
echo basalt
hybrid turret
#

is PacketType.Play.Server.SPAWN_ENTITY the correct ProtocolLib-PacketType for spawning a player npc? (What connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc)); with connection.send(new ClientboundAddPlayerPacket(npc));
did in NMS)

echo basalt
#

I can decide that the "killer" is the skeleton that shot the first arrow within the last 15 seconds

hybrid turret
lost matrix
quaint mantle
#

🤣

lost matrix
#

Explain what this code is supposed to do. The method names seem to claim something else than the logic
(This is btw the best way to confuse other devs)

hybrid turret
#

lol

quaint mantle
lost matrix
#

It doesnt if you load the world with your emptychunkgenerator.

quaint mantle
lost matrix
#

No, this just means that you are not loading the world with your emptychunkgenerator anymore

quaint mantle
#

so how do i load a world with the emptychunkgen?

lost matrix
#

Are you trying to use the chunk generator on your default world?

quaint mantle
lost matrix
#

I would start by removing your condition here:

      public World createEmptyWorld(String world) {
        if(worldExists(world) == null) {
            WorldCreator wc = new WorldCreator(world);
            wc.generator(new EmptyChunkGenerator());
            World w = wc.createWorld();
            w.save();
            return w;
        } else {
            return null;
        }
    }
    public World createEmptyWorld(String world) {
        WorldCreator wc = new WorldCreator(world);
        wc.generator(new EmptyChunkGenerator());
        return wc.createWorld();
    }

The condition makes no sense. And the save() call is weird as well.

quaint mantle
#

yeah not sure why i have save there

#

🤣

lost matrix
#

And then you need to tell me if you are trying to use this on your default world (the one defined in server.properties)

lost matrix
quaint mantle
#

i created it initially using createEmptyWorld, but then since then i set that world to my default world

#

in server.properties

#

so it didnt used to be the default world, but now it is

lost matrix
#

Ok, for that you need to define your custom chunk generator in the spigot.yml

quaint mantle
lost matrix
#

Let me check if this information is still correct

quaint mantle
#

thanks!

#

🫡

lost matrix
#

its the bukkit.yml

quaint mantle
#

oh interesting i founmd a method in java plugin (getDeafaultWorldGenerator) - could it be that?

#

oh okay

hybrid trellis
#

How would I know a block is spawned using a cobble stone gen

lost matrix
#

And then configure

worlds:
  world:
    generator: yourPluginName

In your bukkit.yml

lost matrix
hybrid trellis
#

Hook into

lost matrix
hybrid trellis
#

That's 1.21.1 right?

lost matrix
#

Has been there for years

hybrid trellis
#

Ohh

tall dragon
hybrid trellis
#

And how would I know the cause of how it formed

#

Or is it specifically for when lava and water touch

quaint mantle
lost matrix
tall dragon
lost matrix
tall dragon
#

unless theres other stuff that can form cobble i dont know about

quaint mantle
hybrid trellis
#

True

lost matrix
quaint mantle
#

thanks mate!

hybrid turret
hybrid trellis
lost matrix
tall dragon
#

BlockFormEvent#getNewState

hybrid trellis
lost matrix
#

Show code plox

hybrid trellis
#
public class BlockForm implements Listener {
    @EventHandler
    public void onPlayerQuit(BlockFormEvent event) {
        Block formedBlock = event.getNewState().getBlock();
        Bukkit.getServer().broadcastMessage(formedBlock.getBlockData().getMaterial().toString());
    }
}
#

Ignore the name

lost matrix
#

-.-

tall dragon
#

-,-

hybrid trellis
#

I forgot to change it

hybrid turret
#

i thought i wouldnt need NMS anymore if i used protocollib

tall dragon
#

bruv

#

look at what ur doing

hybrid trellis
#

I don't get it

lost matrix
#

Block is a Position. If you get the Position at that events time, and check the type on this Position, then you will get the BlockState before the event happened.

You need to check the type on the new BlockState.

tall dragon
#

yea ur bassically getting the old state again

#

in a weird way

hybrid trellis
#

getNewState is is the old one?

slate siren
#

I'm here nowww

hybrid turret
tall dragon
#

yes and then u do getBlock

slate siren
#

@lost matrix I'm going home now sir, I'll test the code you wrote

lost matrix
tall dragon
#

which is going to be the current or "old" block

#

u can just call getType directly on the new state

#

instead of getBlock

lost matrix
#
  @Override
  public void onEnable() {
    Bukkit.getPluginManager().registerEvents(new Listener() {

      @EventHandler
      public void onForm(BlockFormEvent event) {
        event.getBlock().getWorld().createExplosion(event.getBlock().getLocation(), 5F);
      }

    }, this);
  }

trollface

tall dragon
#

💀

lost matrix
hybrid turret
#

imma come back later, bit much going on here rn lmao

hybrid turret
#

and what the entityId should be filled with, since i can't really know which ids are already in use(?)

echo basalt
#

my boy writing the cursed listeners onEnable 💪

#

you should see my test plugin

lost matrix
echo basalt
#

mood

hybrid turret
#

oh god

lost matrix
echo basalt
#

man do I really want to do all of this for 20 bucks

#

why do modern decompilers still suck at figuring imports woe

lost matrix
hybrid turret
#

bc in NMS they're bytes

echo basalt
#

but hey one more premium plugin fully rebuilt

echo basalt
#

all of this because the mf was doing calls to bukkit.getUnsafe that crash on 1.21

lost matrix
hybrid turret
#

thanks :)

echo basalt
quiet ice
#

Shoulda have used eclipse

quiet ice
echo basalt
#

mfw Ctrl+Alt+L doesn't fix my finances

echo basalt
#

but together

#
  • winrar into intellij for some reason
#

can rebuild like 99% of projects

quiet ice
#

Who in their right mind would use jd-gui in 2024 if Recaf 4X exists

echo basalt
#

recaf takes like 19 years to load

quiet ice
#

Even the EOL Recaf 3X is great

echo basalt
#

also feels more lcunky imo

lost matrix
#

I still use that one jd-gui instance ive downloaded 3 years ago...

echo basalt
#

same

#

I've redownloaded it like 5 times

#

familiarity is key imo

#

I'd still be using intellij 2016 if it weren't for copilot

quiet ice
#

Well, as long as you don't use ghidra I guess

echo basalt
#

and now that my student license ran out I no longer have a need to update thumbsup

#

ain't paying for that

echo basalt
#

you can get it from nms

#

or my personal go-to approach

#

start from like 1 trillion and count up

hybrid turret
#

fair enough lmao

quiet ice
#

Doesn't the bukkit unsafe have a method for it?

#

?jd-s

undone axleBOT
echo basalt
#

prob not

#

I know plib reflection class has it

#

I always feel hella guilty looking up entities by their entityid tho

quiet ice
lost matrix
hybrid turret
#

what does that do? 🤔

echo basalt
#

guess

lost matrix
#

Or to not clash with illusion: Start at minus one trillion and count down

echo basalt
#

make sure to %= if you overflow

#

the chance of colliding with entity 0 is miniscule

quiet ice
#

(let's completely ignore that those are out of range for the ints, so a modulo won't work)

echo basalt
#

and if that happens you prob deserve to restart your server ngl

lost matrix
#

I mean trillion already overflows integers by a ton

lost matrix
#

its like 2.17 bil iirc

echo basalt
#

depends if it's signed or not

#

4.2 something

hybrid turret
#

uhm

lost matrix
#

Yes im talkin about good old 32bit signed java integers

echo basalt
#

doesn't help that intellij is a fucking nerd

quiet ice
#

Well my approach would be to use nextEntityId via MethodHandles which is configured with a fallback of ThreadLocalRandom#nextInt

echo basalt
#

also smile quick question

#

any idea who pinned my message in #general

#

?

hybrid turret
echo basalt
#

need to bribe em rq

lost matrix
#

Real programmers only use HEX.
I dont even know what 1200 is. Do you mean 0x00422F ?

echo basalt
#

oh you know hex?

hybrid turret
#

fr

echo basalt
#

name every torx size

lost matrix
#

Name every number

#

Ah fk

hybrid turret
#

0x0

#

0x1

#

0x10

#

WAIT

#

XD

#

brain fart

echo basalt
#

once went to the chick at the juice bar and told her to name every vegetable

lost matrix
#

Sounds like a recipe for success

echo basalt
#

mfw she named me

hybrid turret
#

0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF
i wont keep going dw

echo basalt
#

ok I'm actually going insane just finished doing imports for what felt like 30 of the same exact class and now I gotta import every hologram plugin known to man

hybrid turret
#

wait a minute.. when i'm trying to spawn an npc with protocollib... how do i set a skin and stuff like that?

lost matrix
echo basalt
#

god bless compileOnly(fileTree(dir: 'libs', includes: ['*.jar']))

lost matrix
#

But i feel your pain. Before i came here they used HolographicDisplays. And that stopped working in 1.20.2

lost matrix
echo basalt
#

hella sleep deprived too

#

just trying to stay awake for 2 more hours

hybrid turret
#

what time is it for u illusion?

echo basalt
#

11am

hybrid turret
#

oh

#

uhm

#

so you just didnt sleep?

echo basalt
#

woke up at like 7pm yesterday

#

all lost

lost matrix
#

Sleeping schedule of the gods, as always

hybrid turret
#

💀

echo basalt
#

💪

hybrid turret
#

i'm at work 💀

echo basalt
#

it's the world renowned "don't bother me" schedule

#

got a meeting at 1pm

#

and then imma honk shoo

hybrid turret
#

i hope so

echo basalt
#

prob gotta pass by a print shop later today

lost matrix
#

Ayy, my denoising Autoencoder trained properly 😄
Time for my next step: VAEs.
(Slowly walking towards a diffusion model for minecraft structures)
Imagine Flux or StableDiffusion, just for buildings in minecraft.

hybrid turret
echo basalt
#

oh ffs

lost matrix
hybrid turret
#

nah i generally want to use plib for all

lost matrix
#

Then do just that

hybrid turret
#

how would i e.g. set a skin for an npc then?

#

or the name

lost matrix
#

Let me leak some stuff for you

echo basalt
#

oo mans leaking stuff

#

where you work now

hybrid turret
#

uh oh

echo basalt
#

watch him say "hypixel" and my soul leave my body

mossy torrent
#

hi everyone

lost matrix
hybrid turret
#

:(

#

tutorials i'm finding are always mixing both

#

sidujfhsedarf

#

crap

lost matrix
#

You basically get the GameProfile wrapper of ProtocolLib and set it to the data packet

hybrid turret
#

oh so the data packet IS sent for the player entity

echo basalt
#

not sure if I have code for that either

hybrid turret
blazing ocean
lost matrix
#

Mine is only nms based

echo basalt
#

I recall making a system where you could overlay skin parts into a player's skin and it'd upload to mineskin and set the player's skin back

blazing ocean
#

same

echo basalt
#

and have fancy hashes so that duplicate skins wouldn't reupload

#

no clue where that code is

#

prob rewrote it in minestom ngl

lost matrix
lost matrix
# hybrid turret gameprofile wrapper?
    WrappedGameProfile profile = new WrappedGameProfile(UUID.randomUUID(), "Bob");
    Multimap<String, WrappedSignedProperty> propertyMap = profile.getProperties();
hybrid turret
#

oh

#

oops

blazing ocean
lost matrix
#
    String skinValue = "";
    String signature = "";
    WrappedGameProfile profile = new WrappedGameProfile(UUID.randomUUID(), "Bob");
    Multimap<String, WrappedSignedProperty> propertyMap = profile.getProperties();
    WrappedSignedProperty property = new WrappedSignedProperty("textures", skinValue, signature);
    propertyMap.put("textures", property);

Something in this direction. But i would have to tinker with it.

#

Hm. Maybe its time for a proper NPCs with ProtocolLib tutorial.

quaint mantle
#

Hi guys i'm trying to shade my plugin but the shadowJar is not working. Here is the build.gradle.kts

plugins {
    id("com.gradleup.shadow") version "8.3.0"
}

apply(plugin = "com.gradleup.shadow")
version = "1.0.0-SNAPSHOT"

repositories {
    mavenCentral()
    maven {
        url = uri("https://libraries.minecraft.net")
    }
    maven {
        url = uri("https://repo.papermc.io/repository/maven-public/")
    }
}

dependencies {
    implementation(project(":lib"))
    compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
}

shadowJar {
    // this dont work
}
blazing ocean
#

you need to make your assemble task depend on shadowing

tasks.assemble {
    dependsOn(tasks.shadowJar)
}
quaint mantle
#

ohh okay

grim ice
#

how would I get an NMS class via reflection in an annotation?

lost matrix
#

Either that or call it manually. Depending on it is preferred in most cases.

grim ice
#

Attribute value must be constant

lost matrix
grim ice
#

how about this?

hybrid trellis
grim ice
#

isn't it possible to get the version with maven?

grim ice
lost matrix
hybrid turret
#

maybe i misunderstood tho

echo basalt
#

the fuck

lost matrix
#

ffs why would you not just use boolean logic for that

hybrid turret
#

what in the fuck is that

echo basalt
#

decompiled code go brr

hybrid turret
#

what are you even doing with this plugin illusion? like what's the task here?

#

ahh

#

oh

#

it's decompiled

echo basalt
#

so there's this one plugin that goes fucky shit with bukkit.getUnsafe

#

I'd use recaf for something like this but paper is fucking up and I'd rather deal with it this way than to figure out how to import paper without recaf shitting the bed

lost matrix
echo basalt
hybrid turret
#

i love and hate learning new stuff bc i feel stupid but i learn new stuff

echo basalt
#

fr why couldn't they setDurability('翿')

hybrid turret
#

RIGHT

sleek creek
#

Works like that in Vistual Studio Code when you program in .JS atleast

hybrid turret
#

PacketType.Play.Server.PLAYER_INFO

#

i suppose

echo basalt
#

panic literally just put my hand on my forehead rn

#

the fuck

#

i'm devastated

hybrid turret
#

wat

#

aren't sounds already enums?? 💀

blazing ocean
hybrid turret
#

why shouldn't they??

blazing ocean
echo basalt
#

cool it took me 2 hours to finally compile

#

this is totally worth the 20$ (like 13€ after all the fees)

blazing ocean
#

tf are you even doing

echo basalt
#

rebuilding project source

#

cool now that that's done I got another hour to kill

#

any ideas on how to not pass out?

hybrid trellis
#
public class BlockForm implements Listener {
    @EventHandler
    public void onBlockForm(BlockFormEvent event) {
        BlockData formedBlock = event.getNewState().getBlockData();
        Location location = event.getBlock().getLocation();
        Material material = formedBlock.getMaterial();

        if (material == Material.COBBLESTONE) {
            BlockData blockData = Bukkit.createBlockData(Material.DIAMOND_ORE);
            World world = location.getWorld();
            world.setBlockData(location, blockData);
        }
    }
}
```Why doesn't it place the diamond ore
echo basalt
#

time for the world famous "try waiting a tick"

lost matrix
hybrid trellis
#

Oh right

#

Forgot that's a thing

hybrid trellis
hybrid turret
#

eh ffs

lost matrix
#

Dont look at the protocol. Look at the NMS packet.

slender elbow
young knoll
#

I too like setting durability to 翿

slender elbow
#

yeah

hybrid turret
#

but idk how that's supposed to help me

#

._.

slender elbow
#

the gp?

hybrid turret
#

gameprofile

#

bc i want to set the skin

#

or WrappedGameProfile ig in case of ProtocolLib

slender elbow
#

mm yeah idk about protocollib

grim ice
#

does anyone have any idea to work around this?

#
@Mixin(value = version + "...")
public abstract class MixinCraftServer {
  @Shadow public abstract Logger getLogger();
  private static String version = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
grim ice
#

if i move it to another class and make it static

#

it tells me that annotation values must be constant

#

are there any alternatives?

floral drum
#

where is mixin from

#

like how do you use mixins

drowsy helm
#

Arent mixins for mods

young knoll
#

They’re for anything java

#

As long as you have something to bootstrap them

grim ice
grim ice
floral drum
#

ah

hybrid turret
young knoll
#

Does wiki.vg document the netty pipeline somewhere?

slender elbow
#

not really

#

like it talks about the framing and stuff but it just talks about the protocol as if it were written in any language with any networking tool

slender elbow
young knoll
#

Mmm, do you know of anywhere that does cover it

#

At the very least the order of handlers

fluid river
#

jree fava lessons

worthy yarrow
#

I love fava

onyx fjord
#

can i force intellij to let me open 2 popup windows at the same time?

#

aka dont remove a window if i click outside

#

i just wrote the funniest code ever

#

but i need 2 popups for context

fluid river
#

probably not

onyx fjord
#

😭

#

basically i implemented two interfaces which extend the same interface in a single class