#help-development

1 messages · Page 1176 of 1

young knoll
#

Idk I think we should take Choco’s kneecaps

worldly ingot
#

That was added in 1.8

young knoll
#

Number Format I think?

worldly ingot
#

Actually, fun fact, you can't see your active effects in 1.9+ in the top right on Hypixel

#

I added that today too lol

young knoll
#

Wow he added the hide particles and hide icon flags

worldly ingot
#

Because it BOTHERED me

remote swallow
#

hes turning into chopixel

torn shuttle
#

wait, what?

#

wdym

#

how

#

how did this come to be

echo basalt
#

because you're probably using List.of

#

or Collections.singletonList

young knoll
#

Well presumably the collection is unmodifiable

echo basalt
#

^

torn shuttle
#

I mean yeah but hm

young knoll
#

Or maybe the collection just isn’t having your shit today

torn shuttle
#

how did it work and stop working

echo basalt
#

peak liskov substitution moment

torn shuttle
#

I think it's because this guy is on a build from a year ago

echo basalt
torn shuttle
#

and using content from two months ago

#

I did change to non-immutable lists a few months back

#

man I simultaneously barely did anything and did a bunch of stuff today

#

I hate these limbos

vagrant stratus
#

Yo @young knoll when ya get the chance can you rewrite this so that it's actually proper plz lmfao
Should be correct for the most part, though I'm failing to optimize it further cause I don't use spigot's api much kek

#

^ me

vagrant stratus
#

Just realized that early returns if the chunks are the same, reee (╯°□°)╯︵ ┻━┻

quaint mantle
#

would the player.setHealth(0); call a PlayerDeathEvent?

vocal cloud
#

Did you try it?

glossy laurel
quaint mantle
spiral light
#

Player#damage(123456)

quaint mantle
#

alright thanks

glossy laurel
spiral light
#

actually minecraft uses: entity.kill(worldlevel)
which then calls:
remove(Entity.RemovalReason.KILLED, Cause.DEATH);
gameEvent(GameEvent.ENTITY_DIE);

quaint mantle
spiral light
#

but its not using damage to kill the player (that wouldnt be clean at all)

quaint mantle
#

alright

quaint mantle
#

can i open a custom menu or do something?? when player open the advancements menu?

#

or can i check, when player open advencement menu?

spiral light
#

i think its client side completly

blazing ocean
#

oh thats S2C

drowsy helm
young knoll
#

Event when?

silver robin
#

I can always keep the hunger at maximum with this: (aside from checking if the entity is a player etc etc) java @EventHandler public void onHunger(FoodLevelChangeEvent event) { event.setFoodLevel(20); } Is it possible to disable client-side shaking of these meat icons when the player is sprinting? Is it possible to hide the hunger bar without texture pack?

blazing ocean
#

You can't hide it without a resource pack no

#

But you can use the saturation effect

silver robin
#

the saturation effect puts an icon in the inventory and top-right and also gives particles (which maybe can be hidden by cancelling packets... but idk) which is worse than just the small shaking
but I thought there's another way
thanks though

young knoll
#

Saturation can be hidden in the top right

#

And the particles

#

I don’t think you can hide the inventory icon tho

silver robin
#

I mean does it actually disable shaking?

#

becuase I don't see how if all of that is server-side

blazing ocean
#

how is that server side

young knoll
#

It’s based on saturation

blazing ocean
#

You can also just rename the status effect with a resource pack

young knoll
#

Iirc it shakes when your saturation drops

blazing ocean
#

yea

silver robin
#

but if server never lets the saturation drop, hunger bar shouldn't shake if i'm not mistaken

blazing ocean
#

yea

silver robin
mortal hare
#

this is my first time i've seen LLM admit they dont know it 100%

vital sandal
#

Sorry for off topic question but do you guys know any simulator that simulate logic gate with builtin VHDL simulator (similar to logisim evolution but not using ModelSim)

proper cobalt
#

would u not just use a boundingbox

#

or wg

proper cobalt
mortal hare
#

only for certain things

#

that Program is so old

#

and my uni forces it to use it

#

i mean it still has windows XP like toolbar

#

it doesnt even have antialiasing for font rendering

proper cobalt
#

its just a pixel perfect font

#

i like those

#

f aa

#

this is my favourite

vagrant stratus
# proper cobalt or wg

I don't need any of the functionality WG has, so it'll just overcomplicate things, and I need more than just a bounding box so I'd still need to create a class, which uses a BoundingBox & go from there

proper cobalt
#

what u even trying to do

vagrant stratus
#

Eh. I already have it mostly sorted, no point in rewriting it to use a bounding box.

vagrant stratus
# proper cobalt what u even trying to do

trigger zone -> designated area within a game where entering or interacting with it causes a specific event or action to occur.
Usually invisible, many things use this or similar lol

young knoll
#

I'm sure some smart people can spot additional improvements and things I messed up

vagrant stratus
#

Yea, I think I cam work with that

vagrant stratus
#

I assume I just RegionManager#getRegions(Chunk) & then do my checks as usual @young knoll ?

young knoll
#

There's getRegionsForLocation

vagrant stratus
#

Ah, guess I'd just extend region then and go from there KEK

young knoll
#

You're free to just copy the code and make the changes you need directly

#

To region

worthy yarrow
#

Anyone here know how mojank handles y axis generation when it comes to world / chunk generation?

vagrant stratus
#

Yea, might as well just extend region. I'm sure i'd come up with some other use for it too lol

worthy yarrow
#

Need a rough idea of how it’s done so I can try and do something similar in my wfc impl

young knoll
#

The main thing is just 3D noise

remote swallow
worthy yarrow
#

To be fair now that I'm thinking about it, I've got a relatively simple fairway pathing function already implemented, technically speaking I just have to flip the direction if you will to produce hills and such.... I think

eternal night
#

Wrong reply

vagrant stratus
eternal night
#

Like, the way WG does it is a tree

vagrant stratus
worthy yarrow
vagrant stratus
#

inb4 no hill

worthy yarrow
#

What's inb4 kek

blazing ocean
#

inbefore

worthy yarrow
#

huh I dont get it

#

It's too early for jokes 😦

vagrant stratus
#

inb4: used to predict something that will be posted by another user

young knoll
vagrant stratus
#
in before
“Inb4” (short for “in before”) is used to predict something that will be posted by another user. “Inb4” can also be used to predict something that will happen, like a thread being locked or a user being banned.
remote swallow
worthy yarrow
#

Damn so you're saying I'm not gonna make hills?? D:

vagrant stratus
#

inb4 it's anything except a hill

worthy yarrow
#

I think you're just a hater

vagrant stratus
#

kek

vagrant stratus
#

no it's you

worthy yarrow
#

D:

#

Damn

vagrant stratus
young knoll
#

Well there you go

#

You can use that :p

worthy yarrow
#

I don't have access

young knoll
#

Can't you join the server by channel link

#

Idk how it works

blazing ocean
#

no?

remote swallow
#

on some you can

blazing ocean
#

it says #unknown

vagrant stratus
worthy yarrow
young knoll
#

boo

#

Discord smelly

vagrant stratus
young knoll
worthy yarrow
#

Hmmm chunk alignment for my tile placement would be cool

vagrant stratus
#

Eh. If anything I can just use Colls solution 😎

#

Yea, no idea how to use that repo in a real-world scenario and I'm not gonna dig through WG just to see how they impl it

umbral ridge
#

How are your old pcs optic 🤓😂

vagrant stratus
#

in storage

vagrant stratus
proper cobalt
#

just use wg 🤦‍♂️

vagrant stratus
#

Don't need it

#

Overly complicated for what I need

#

I don't need literally any part of WG outside of the region stuff, so there's no point making it a hard requirement.

vagrant stratus
vagrant stratus
vagrant stratus
vagrant stratus
spiral light
#

you just want to do actions / allow stuff in specific regions ?

vagrant stratus
#

There's a lot of other stuff that this specific thing will depend on

#

see the bare minimum

#

It's a trigger, the things you can do with it are basically infinite as long as you code it in kek

inner mulch
#

when i use a kotlin extension function, can i call it from java?

remote swallow
#

as an extension, no

blazing ocean
#

It's just a static function taking in the original class

#
fun String.test() = true

turns to

public static bool test(String string) {
    return true;
}
#

or something similar

inner mulch
#

okay, so i cannot use it from java :/

blazing ocean
#

No, that's why it's a kotlin feature

sly topaz
#

extension functions are just syntax sugar for static methods

#

so, yeah

slender elbow
#

you can use them from java, just not as foo.bar()

shadow night
#

bar(foo)

vagrant stratus
vagrant stratus
#

Yeah, WE lmfao

#

the one useful class isn't updated for 1.21.1 and uses nms and is a bitch to update (╯°□°)╯︵ ┻━┻

silver robin
#

this can create a new world: java WorldCreator wc = new WorldCreator(worldName); World newWorld = wc.createWorld(); if (newWorld == null) { player.sendMessage("§cnewWorld == null"); return; } player.teleport(new Location(newWorld, 0, 0, 0)); player.setFlying(true); but I'd like the world to be temporary, preferably only in memory but that could be complicated, so I'll stick to removing all players out of it and then calling Bukkit#unloadWorld, but are there any other references to the world in other places which I should clear before deleting the world files?

young knoll
#

Only if you store references to it

silver robin
#

ah okay so it's completely safe then
is there a way to disable creating the files at all without using reflection and touching stuff i'm not supposed to? (I guess it would work - it's still a world but without calling the serialization code)

sly topaz
#

it isn't possible without touching internals, no

#

even by using internals, I think it's pretty doomed? IIRC the whole thing kind of depends on files existing

#

you could probably get away by using a fake file system or something but eh

#

and even if you do manage to do it, you'd have to re-implement it for Paper since they do change a bunch of that stuff kek

silver robin
vagrant stratus
sly topaz
#

simply because you'll have to endlessly worry about it shitting on itself on newer versions in unexpected ways

#

better just depend on WE/FAWE and let them worry about the side-effects of that

vagrant stratus
#

Actually, that wouldn't be a big problem for me as I already deal with NMS in another resource lol

sly topaz
#

I mean, it isn't so much about dealing with NMS but understanding and keeping up with the underlying system

#

plus if you support Paper at all, the system is wildly different so you'd also have to understand paper changes on top

vagrant stratus
#

Fuck paper lol

shadow night
eternal night
sly topaz
#

eh, now that Moonrise is its own separate thing, it is easier to keep up with than reading the mumbled together patches

vagrant stratus
#
import net.minecraft.server.v1_9_R2.BlockPosition;
import net.minecraft.server.v1_9_R2.Chunk;
import net.minecraft.server.v1_9_R2.EntityPlayer;
import net.minecraft.server.v1_9_R2.EnumSkyBlock;
import net.minecraft.server.v1_9_R2.IBlockData;
import net.minecraft.server.v1_9_R2.Packet;
import net.minecraft.server.v1_9_R2.PacketPlayOutMapChunk;
import net.minecraft.server.v1_9_R2.PlayerChunk;
import net.minecraft.server.v1_9_R2.TileEntity;
import net.minecraft.server.v1_9_R2.World;
young knoll
#

Those are old spigot mappings

sly topaz
young knoll
#

Also the version isn't part of NMS classes anymore

vagrant stratus
#

Yea, I know lmao

silver robin
shadow night
vagrant stratus
#

and again, some of those classes just outright don't exist anymore which is where the struggling is from lol

young knoll
#

Hey net.minecraft.server still exists

#

smh

vagrant stratus
#

PacketPlayOutMapChunk for example

#

Unless it's just renamed (╯°□°)╯︵ ┻━┻

young knoll
#

ClientboundLevelChunkWithLightPacket

vagrant stratus
#

jfc and I thought some of my names were long KEK

blazing ocean
#

that's not even that long

sly topaz
#

mojang usually isn't too bad with the names

#

they're really bad with the generics though

blazing ocean
#

my favourite interface

sly topaz
#

what was that codec with a bunch of generic params lol

vagrant stratus
sly topaz
#

keeping up with the changes, probably 😛

young knoll
#

50% memory 50% searching "chunk" in the mappings site

vagrant stratus
#

Ah

#

I just searched up the name as one normally would 😎

blazing ocean
#

linkie my beloved

young knoll
#

I knew it was ClientboundSomethingChunkSomethingPacket

vagrant stratus
#

lol

silver robin
#

how can I find out where these messages are coming from? I'd like to disable printing them, I hope I don't have to hook into log4j
i though of searching string "Modifier:" but no idea where to search

sly topaz
#

be it either via a filter or some other way

young knoll
#

It's the top match

silver robin
#

AAAAAAAA it's this small thing

sly topaz
#

tbf I also didn't see it at first glance lol

vagrant stratus
sly topaz
#

are these per server

sly topaz
vagrant stratus
#

too bad 😎

young knoll
#

I don't think worldedit does anything fancy

#

FAWE does but that's another story

silver robin
#

worldedit does everything in a single tick, no?

young knoll
#

yes

#

They might use NMS to set the block directly, but that's about it

sly topaz
#

what's up with FAWE nowadays, is it still reliable or did it go back to being unreliable

vagrant stratus
#

Yea, it's using NMS

high prairie
#

Does anyone know how to add custom advancement toasts, since my current code just doesn't send anything

grand flint
#

cuz i got them as well i never added them

#

they r user apps, u use them in every server

#

but why do they display if i didnt add them to my user

earnest girder
#

is there an event for when a player changes the item they are holding? either by selecting items in their hotbar or by moving items in their inventory?

silver robin
young knoll
#

PlayerItemHeldEvent fires when they change via the number keys

#

No direct event fires if they move items tho

silver robin
young knoll
#

You can use a runnable

#

Or the inventory click event

silver robin
inner mulch
#

can i get the types of a class? like Map<String, Integer>, i would want to get String.class and Integer.class

blazing ocean
#

generics don't exist at runtime

silver robin
#

ah getting specifics from generics

inner mulch
#

not even class generics?

blazing ocean
#

no

silver robin
#

I mean if the map is not empty is it possible to get any entry from it and extract classes from it?

blazing ocean
#

and what the fuck is the xy

inner mulch
#

serialization

#

optimization

young knoll
#

You can actually get the generics from a declared field

#

ie List<String> strings = blah blah

inner mulch
#

how would i get String.class from that?

young knoll
#

I love how deep the copy/paste has gone on that class

#

From RedLib to my lib to Pineapple

inner mulch
young knoll
#

create(String)

remote swallow
#

wow you actually found the class

young knoll
#

Wasn’t that hard

rapid wharf
#

im working with configs, how can i get all children of fines config section?

lilac dagger
#

Ye

chrome beacon
#

on the fines configuration section

dire maple
#

Hello, I am back with likely a "duh" type of question. What is the process for removing an armor piece from somebody's armor content inventory? Is it just #getInventory().remove(ItemStack armorPiece);?

#

I have code for a custom death system for my plugin, and I am trying to force-drop Binding Curse armors... this code unfortunately does not remove the not null ItemStack armorPiece from their inventory using the method above

pure dagger
dire maple
pure dagger
#

then like EquipmentSlot.HELMET but idk if its a method im on phone

dire maple
#

hmmmmm ok

#

That seems to work. Interesting! Thank you so much

#

Merci, have a wonderful weekend

young knoll
#

You can just set the slot to null

pure dagger
#

umm

#

there is actually that method?

young knoll
#

Player#getEquipment#setHelmet(null)

pure dagger
#

because i see my solution doesnt exist

humble terrace
#

Im looking for work, so if you guys need a plugin made read my bio and i can hlep

young knoll
#

?sergices

#

?services

undone axleBOT
humble terrace
#

ok

woeful finch
#

Maybe not the best channel to post this in but; what folder structure does everyone here use to organize their projects?

#

I personally tend to create folders for everything my plugin tries to do (e.g. a folder for teams, discord (integration), database utilities) but this gets messy over time

sullen marlin
#

sounds like a reasonable structure too me

#

why is it messy?

woeful finch
# sullen marlin why is it messy?

Deciding between two categories is harder. Maybe it's just a problem with my way of doing things, not sure, but at one point you will code something that might fit in multiple categories. Could also just be overthinking this, I dunno.

river oracle
#

structure however you see fit

#

the only normal structure you should adhere to is the src/main/java and src/main/test folders

#

also using your package name, but otherwise honestly whatever you do is up to you

drowsy helm
drowsy helm
#

like if you have a discord manager class, and a teams manager class, and database manager I would partition those to their own folders

#

then a shared folder generally

woeful finch
#

hmm i see

drowsy helm
#

but try not to fall for analysis paralysis

#

at the end of the day it doesn't matter that much

woeful finch
#

Guess this is that one occasion where github search comes in handy lol

nova notch
earnest girder
#

Why is my inventory open event not firing?

public class InvOpen implements Listener {
    public InvOpen(Wicklow2 plugin) {
        Bukkit.getPluginManager().registerEvents(this, plugin);
    }

    @EventHandler
    public void onOpen(InventoryOpenEvent event) {
        System.out.println("EVENT CALLED"); //never printing

        PlayerMemory m = MemoryUtility.getPlayerMemory((Player) event.getPlayer());
        System.out.println(m.isReloading());
        if(m.isReloading()) {
            event.setCancelled(true);
        }
    }
}

Main:

new InvOpen(this);
sullen marlin
#

it wont fire for the player's own inventory (client doesnt tell server)

#

it will fire for chests etc

earnest girder
#

fcuck

buoyant viper
valid burrow
#

like what is your end goal

nova notch
#

took me 20 min to make an interface and a record

#

im so efficient with my time

tawdry lava
#

My buildtools on mac doesnt open gui earlier it did then i installed jdk 21 via homebrew and gui stopped and it wld extract in the bground. any idea how to fix?

river oracle
#

Or have you only tried the dmg file

tawdry lava
#

but when i directly open the jar it does stuff in background no window and terminal works but i want the gui

river oracle
# tawdry lava via terminal ?yes

Weird when we made that gui we have like one guy who had a Mac so it might be nearly impossible for me to actually bug fix here. Best you can try is running it from the command line at this point

tawdry lava
#

this broke when i installed a new java version is it related to that? whay jvm shld i be using aac to the mac guy?

river oracle
#

No clue I usually have a 10,000 foot poll between myself and any apple project

river oracle
#

Might be useful to see if you get a stacktrace

tawdry lava
#

how do i?

river oracle
#

Run it just add --gui

tawdry lava
#

k

#

that worked

river oracle
#

Might be an issue with launching through double click on Mac

#

In which case we can't do much

tawdry lava
#

AWT error

river oracle
sage patio
#

I'm listening to ClientboundBlockUpdatePacket for canceling block updates, the problem is when i right click on 1 block, 1 time, i receive the backet 4 times for 2 diffent xyz, any idea why?

fading drift
#

for my minigame I have a kit, however I have split my plugins into 3, one lobby, one for minigames, and a core plugin
should I store the kit data into core, lobby or minigame considering I have to access the kit in minigames and modify the kit in lobby

rough ibex
#

I would imagine minigames

#

since core would be used by both; are kits used by both? probably not

fading drift
#

core contains like the framework for both plugins

#

the database is split into core, lobby, and minigames

#

however I need to access the kit from minigames and also change it from lobby

#

and lobby does not load the minigames part of the database

#

and vice versa

#

but I want to keep all my match related code together tbh

#

I got it figured out tbh

#

gonna keep it all inside minigames

#

and then just modify it directly from lobby

tawdry lava
#

what is the latest specialsource version? for 1.21

mortal vortex
#

2.0.3 on maven

tawdry lava
#

k

mellow edge
#

you can detect when a player presses something in the player's inventory tho so you can still do something

summer scroll
#

Apparently this line throws an error
WrappedDataWatcher watcher = new WrappedDataWatcher();

neat jetty
#

Could anyone help me set up bungeecord?

chrome beacon
neat jetty
#

oops sorry

chrome beacon
chrome beacon
summer scroll
#

Okay, just tested, same errors.

#

Same errors on server version 1.20.1 and 1.21.

chrome beacon
#

It runs a different piece of code for it

#

Send that error

summer scroll
chrome beacon
#

Yeah that's an entierly different error

#

Why did you say it was the same

summer scroll
#

I just remembered, my bad

chrome beacon
#

also any reason why you need packets for that

summer scroll
chrome beacon
#

Having a regular armor stand as passenger won't have much of a peroformance impact

#

It will just save you a lot of time

summer scroll
#

We need two armor stands per player.

chrome beacon
#

are both passengers

summer scroll
#

Yes passengers

chrome beacon
#

I would try it and see

#

I don't think it matters that much

summer scroll
#

Oh and also if I remember correctly the player cannot be teleported if there is an entity mounting them.

chrome beacon
#

at 200 players you have other concerns

summer scroll
#

I think that's the main reason why I need packets.

chrome beacon
#

Try it and see

#

I'm only aware of issues when a player is the passenger

summer scroll
#

I have actually, the player cannot be teleported if there is an entity mounting them.

#

Specifically armor stand, I only tested with armor stand.

chrome beacon
#

Looks like an open issue

summer scroll
#

Yeah I remember that when I got the same stress as Billy in the comment section had 2 years ago lmao

#

My best bet is to wait for ProtocolLib has a fix for that then?

silver robin
#

How does .setCollidable() work()
I have two accounts on the server, set collidable to false for both but they can still push each other
If I call A.hidePlayer(B) (so A cannot see B), then B can push A, but cannot be pushed by A (B doesn't feel anything when pushing A) (this behaviour may be different on paper, the same with placing a block into a spot where someone who is hidden from you is standing, but i'm talking about collisions specifically)

young knoll
#

I don’t think it really works

#

Use teams

silver robin
#

are pushing physics clientside or serverside?
nvm I'll just set collisionRule to never for all teams since some players are in various teams

mortal hare
# mortal hare

btw i forgot to mention that this software that SAP pushes is so bad that it needs Visual Basic compatibility installed in Windows 11 for its functionality

peak depot
#

is there a way to have custom invs of the same type by changing the inv name?

young knoll
#

?

peak depot
#

wait

#

like that those both be in while using the generic54 textutre but named diffrently

#

like that in that

spiral light
#

you can create more then 1 inventory with different items and names ^^

peak depot
#

so then just call it eg inv1.png and then use Bukkit#createinv(null, 54, "inv1") or how

pliant topaz
#

wait

#

do you like want to use different textures?

peak depot
pliant topaz
#

I mean, your inventory will be dynamically created, the texture scales

pliant topaz
#

u would need some sort of custom font character which acts as an overlay. Or use one slot of the inventory for an item with a custom model also acting as the overlay

#

changing the texture itself would only be useful if it should be applied to any kind of this inventory type

peak depot
pliant topaz
#

yes

#

ofc some things might've changed in newer versions (talking about how ressourcepacks are structured etc)

mortal hare
#

i wonder if we could use minecraftvanilla shaders to draw GUI's

#

do shaders work outside fabulous graphics mode?

#

i've saw some mimimap concept made with serverside position handling code and then it somehow informs shader with necessary information to draw the position and surroundings

#

basically he made serverside minimap mod with server resource pack

pliant topaz
#

you technically could but that doesn't mean that you should

#

Vanilla shaders are not that efficient and by drawing an entire gui it could theoratically cause fps drops especially on lower end systems

#

which isn't ideal

mortal hare
pliant topaz
#

but could be a nice concept to allow for more dynamic guis

pliant topaz
mortal hare
#

i mean utilizing some kind of vertex shader and fragment shader doesnt sound that bad

pliant topaz
#

it isn't really, it's just that afaik the shaders offered by resourcepacks are way less performant

#

but as a normal shaderpack it could definitly be something to consider

#

but would also require iris or some sort

#

i kinda fell in love with that idea now ;-;

woeful finch
#

Getting back into plugin development; ChatColor seems to be deprecated. Trying to translate color codes into actual colors using ChatColor.translateAlternativeColorCodes, what should i use instead?

pliant topaz
#

the new components

#

ah wait no (accidentally switched it up with paper)

young knoll
#

ChatColor isn't deprecated on Spigot

woeful finch
#

Yeah I'm using paper. I remember using that, mb

dire maple
#

Curious to know if I need to set the line width and other characteristics in a TextDisplay entity?

young knoll
#

You don't need to, no

dire maple
young knoll
#

No idea

desert aspen
dire maple
# young knoll No idea

Ok, I have the text display - it is displaying text as intended. I am unsure how to remove the chat background from the text

#

I believe it's possible?

young knoll
#

Background color

dire maple
#

Do I specify as null maybe? Sorry

young knoll
#

One with 0 for the alpha

quaint mantle
#

To create scoreboard teams is better to use the main scoreboard or using new scoreboard and show it to the player. For example for a duels plugin that have red/blue team?

proper cobalt
#

cuz line width in in pixels

#

but u cant get the pixels in a string

echo basalt
#

technically you can

barren peak
#

whats best way to get hypothetical damage an item would deal if it were to hit a player

echo basalt
#

that's a tricky one. pretty sure I resorted to doing all the damage math myself in the past

#

problem's mostly just dealing with attributes and enchants

barren peak
#

alright

pallid idol
#

Hey can i get the right Click on an Armorstand?
the event PlayerInteractEntityEvent doesn't work and the PlayerArmorStandManipulateEvent is not the simple right click

young knoll
#

PlayerInteractAtEntityEvent

pallid idol
#

I try

barren peak
#

any way to set sword's attack damage & pickaxe mine speed withought nms?

young knoll
#

Attributes

barren peak
# young knoll Attributes

im.getAttributeModifiers().put(Attribute.GENERIC_ATTACK_DAMAGE, what do you put here? It takes type AttributeModifier);

#

AttributeModifier class is a bit weird, been looking at javadocs

young knoll
#

ItemMeta#getAttribute(Attribute).addModifier(Modifier)

barren peak
#

ItemMeta doesn't seem to have the getAttribute method. is it a different itemMeta? (EX: is there a sword meta or something)

young knoll
#

Oh it's just ItemMeta#addAttributeModifier

barren peak
#

right but that takes in an AttributeModifier which has a bunch of weird parameters. can I just get the existing damage modifier on the sword and increase it? or is there not one...

slender elbow
#

that's what the modifier is for

#

create one for your custom modifier id (like plugin:cool-damage-increase), with the amount and just add operation or whatever

young knoll
#

Material#getDefaultAttributeModifiers

barren peak
#

is Material.WHEAT used for both the item and the crop?

kind hatch
#

@pseudo hazel Do you think any documentation is needed for AdvancementRequirements? Compared to regular advancement criteria and when developers should use it?

pine forge
#

Hey sorry this is old but how exactly would this work? Do i start a task when i first open the websocket connection and then close it on stop? They dont seem to have a method to run code on stop

sly topaz
#

if you ultimately want to, for that kind of thing you'd want the main scoreboard

sly topaz
#

ultimately for the block

pallid idol
#

Is it possible to get the NBT data from a playerhead that I click? and if so, there are dics for that

river oracle
#

What data do you want

#

You could use pdc

upbeat pike
#

can i pay somehow else, without using paypal?

#

i would like to buy 2 different plugins but the only way to pay is paypal and i dont have it and i cant make it as well

pallid idol
pallid idol
#

i cant upload a image sec

kind hatch
#

?img

undone axleBOT
#

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

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

pallid idol
kind hatch
sly topaz
#

actually that won't return the nbt per se, just the block state

river oracle
upbeat pike
kind hatch
#

I think they want the texture value

upbeat pike
#

like why, then they are not geting my money

river oracle
#

All of them? If so just do as Javier said

#

If it's the texture it's in the BlockState

pallid idol
river oracle
#

Why

pallid idol
river oracle
#

Are you displaying it?

lilac dagger
river oracle
pallid idol
sly topaz
#

what custom values

kind hatch
#

^

river oracle
#

Yeah like what are you on about

sly topaz
#

is there something you are adding in the NBT?

river oracle
#

It seems like you should be using PDC

sly topaz
#

if so, you should be using PDC for that

pallid idol
sly topaz
#

that is the PDC

kind hatch
#

Ah, the non pdc values. :p

river oracle
pseudo hazel
#

oh the map of string strings right?

pallid idol
#

ok but I can't use or set pdc with every block but that's exactly what I want

sly topaz
#

I think the PR that added that explained it pretty well

pseudo hazel
#

well it should be used if the normal criteria arent sufficient

young knoll
#

?blockpdc

undone axleBOT
pseudo hazel
#

which would be when you actually want to know the progress of someone's advancement

river oracle
kind hatch
river oracle
#

Utterly pointless here

pseudo hazel
#

oh

young knoll
pseudo hazel
#

well I havent kept up with those changes

river oracle
#

Oh

#

Didn't see that

pseudo hazel
#

for now ive just been using the nms for it

sly topaz
#

yeah but blocks don't have nbt, so they're most likely confused

kind hatch
#

Nothing too complicated. Just some abstraction around the list of list of strings

pseudo hazel
#

i'd have to read over them and see what the original reason was for me wanting to have it separate

kind hatch
#

AdvancementRequirements (parent list)
AdvancementRequirement (sublist)

pseudo hazel
#

but pretty sure that was just because without the requirements its impossible to know the progress of complicated advancements

kind hatch
#

AdvancementRequirement#getRequiredCriteria()

pseudo hazel
#

like complete any vs complete all

#

yeah

kind hatch
#

Do you have stash access?

pseudo hazel
#

idk if its already there but a snippit from the minecraft wiki could be added

#

on how the advancements work in the json format

#

idk

kind hatch
pseudo hazel
#

do I just log in with my spigot account?

remote swallow
#

No you need a jira account and to have signed the cla

pseudo hazel
#

I dont have permission to access bitbucket

kind hatch
#

I wonder why the PRs aren't publicly viewable sometimes.
It shouldn't harm anything since the only people who can submit PRs are the ones with accounts. (i.e. the ones who have signed the cla)

young knoll
#

View and create perms aren't separated

kind hatch
#

That's hella dumb

young knoll
#

Blame atlassian

sly topaz
#

bitbucket L, gitlab handles this properly

kind hatch
#

I will

blazing ocean
#

bitbukkit

young knoll
#

Gitlab killed their open source edition's features

pseudo hazel
#

so how do I get permission

eternal night
#

sign a little contract typing

young knoll
#

?cla

undone axleBOT
pseudo hazel
#

time sell my soul to md

blazing ocean
#

oh not just your soul

kind hatch
#

one of us

#

one of us

blazing ocean
#

your firstborn too

pseudo hazel
#

I need to give my full name?

#

yikes

blazing ocean
#

and address

young knoll
#

a dress

eternal night
#

and phone number

young knoll
#

You have to wear a dress

sly topaz
#

I don't remember doing that myself

#

however I signed it in 2016 so it could've been the case

pseudo hazel
#

I can see the kanban board

#

does that mean it worked?

pallid idol
#

only one thing can i use the pdc for all blocks or only for the Blocks with inventory (Chests and Playerheads...)

(yes i know i can set NBT for entitys but i now mean only this^^)

sly topaz
#

if you want to set PDC for non-tile blocks, use chunk pdc

#

?blockpdc

undone axleBOT
pallid idol
#

thnaks yes the rest i know i was not sure abour more block can have pdc.

#

but this is the same as the older versions.

pseudo hazel
#

okay well signing the cla is going a bit too far imo

sly topaz
#

it is a trivial thing

pseudo hazel
#

so ill just once again explain why I wanted to access the advancement requirements, and thats simply because I wanted to distinguish between advancements that only need you to collect a single item out of a possible list, and advancements that require you to complete the whole list

sly topaz
pseudo hazel
#

yes

#

dont tell anyone but im using paper userdev

#

so its like 1 line of code

sly topaz
#

I mean, you'll have to do a little reflection

#

since the handle isn't exposed

kind hatch
#

I think I can link back to the minecraft wiki as part of the documentation if anything.

pseudo hazel
#

yeah

#

should be sufficient

#

return ((CraftAdvancement)advancement).getHandle().value().requirements().requirements().size(); idk if this counts as reflection

blazing ocean
#

that is not reflection

#

spigot accesswideners when

#

well I had an idea earlier

sly topaz
blazing ocean
#

you just have a compiler plugin that expands those invocations/references to reflection calls

#

but that's also pretty ass

pseudo hazel
#

right

#

it does for me 🤷

kind hatch
sly topaz
#

wait what

#

oh yeah it does, I was just blind

#
private static final MethodHandles.Lookup LOOKUP;
private static final VarHandle HANDLE_VAR_HANDLE;

static {
  try {
    LOOKUP = MethodHandles.privateLookupIn(CraftAdvancement.class, MethodHandles.lookup());
    HANDLE_VAR_HANDLE = LOOKUP.findVarHandle(CraftAdvancement.class, "handle", AdvancementHolder.class);
  } catch (ReflectiveOperationException e) {}
}

public static AdvancementHolder getHandle(Advancement advancement) {
  return (AdvancementHolder) HANDLE_VAR_HANDLE.get(advancement);
}

so I wrote this for no reason

pseudo hazel
#

yeah

#

guess so

#

maybe its newer

#

idk when you wrote this

sly topaz
#

I just did a minute ago

#

I was looking at the craftbukkit source but I just didn't see the getHandle method

#

I did find it strange since all craft classes have a way to access the handle

solid lake
#

Is it a flag ? or it is the lore of the item ? how can i remove it ?

(i talk about the "Wild Armor Trim", "Applies to:" and "Ingredients")

kind hatch
#

ItemFlag#HIDE_ARMOR_TRIM

solid lake
# kind hatch ItemFlag#HIDE_ARMOR_TRIM
ItemStack Item = new ItemStack(Material.WILD_ARMOR_TRIM_SMITHING_TEMPLATE);
        ItemMeta meta = Item.getItemMeta();
        Item.setAmount(1);
        assert meta != null;
        PersistentDataContainer data = meta.getPersistentDataContainer();
        data.set(Keys.custom_GuiItems, PersistentDataType.INTEGER, Keys.GUIItems.get(Keys.PremiumTrue));
        meta.setDisplayName("§x§2§F§F§A§E§2§lP§x§6§8§F§C§E§9§lR§x§A§0§F§D§F§1§lE§x§D§9§F§F§F§8§lM§x§9§E§E§C§E§B§lI§x§6§3§D§A§D§E§lU§x§2§8§C§7§D§1§lM");
        List<String> lore = PremiumTrueGetStrings();
        meta.setLore(lore);
        meta.setUnbreakable(true);
        meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
        meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        meta.addItemFlags(ItemFlag.HIDE_ARMOR_TRIM);
        meta.addItemFlags(ItemFlag.HIDE_DYE);
        meta.addItemFlags(ItemFlag.HIDE_PLACED_ON);
        Item.setItemMeta(meta);
        PremiumTrueHomes = Item;

this is my code...

kind hatch
#

Oh, it's the template itself

solid lake
#

i tried everythings lmao

kind hatch
#

You'll probably want #HIDE_ADDITIONAL_TOOLTIP

solid lake
#

thats an API ?

kind hatch
#

Yes

solid lake
#

bruh

#

TY for helping maybe

blazing ocean
#

"maybe"

kind hatch
#

If not that, it may be #HIDE_ENCHANTS

#

Minecraft is very weird on how they categorize those tooltips

solid lake
blazing ocean
#

shadow did you see mine and raydans project

solid lake
kind hatch
blazing ocean
solid lake
#

whats the problem ?

blazing ocean
#

basically

kind hatch
#

Oh yeaaa

blazing ocean
#

spigot plugin development toolchain

kind hatch
#

spigotclip baby

blazing ocean
#

not directly

sly topaz
blazing ocean
#

ignore how like

#

I fucked up

#

and got 226 more commits to my name

remote swallow
#

i think

#

you need a bot account

blazing ocean
#

I probably should make one yea

kind hatch
#

Those are some large patch files. :p

blazing ocean
#

the entire repo is about 6gb

kind hatch
#

Yeeeesh

sly topaz
#

you need to put these into folders so one can do sparse checkout

blazing ocean
#

and i've just fucked everything

#

yay

#

because I forgot to fucking recompile

kind hatch
#

Oh, I'm dumb. I thought it was a git patch.

sly topaz
#

inb4 someone forks whatever this is and introduces malware on the binary patches

sly topaz
blazing ocean
#

bsdiff yea

blazing ocean
#

I mean tbf

#

just adding a gradle plugin can cause you to get malware

sly topaz
#

you need to introduce a signing mechanism so people don't abuse of it

blazing ocean
#

We are doing hashing

#

elaborate tho

#

and I mean

#

the patch generator is open source

remote swallow
sly topaz
blazing ocean
#

why exactly

eternal night
#

yea idk, sounds pretty useless

blazing ocean
#

I mean

#

you can literally just bspatch the vanilla jar with the generated patches

#

which is also just what the tests do

river oracle
silver robin
#

I've noticed that this doesn't work if the player joins the server for the first time. (the player is teleported somewhere else). It works when they rejoin right after. The message still gets logged, its the setSpawnLocation that doesn't work. I'm using multiverse-core but it shouldn't be a problem because i've set it as a depend in the plugin.yml, and this handler is registered after, so this one should be the last. Where's the problem? java @EventHandler(priority=org.bukkit.event.EventPriority.HIGHEST) public void onSpawn(PlayerSpawnLocationEvent event) { getLogger().info("Setting spawn location for " + event.getPlayer().getName()); event.setSpawnLocation(new Location(minigameWorld, 21.690, 65.0, -26.928)); }

lilac dagger
#

it works for sure

silver robin
lilac dagger
#

i think multiverse core teleports the player during player join event

#

first join / second join doesn't exists in spigot/bukkit

mortal hare
#

am i going crazy or what? i've discovered a phenomenon that the longer i design something in figma the more i dislike it, but then you come back months later to see the result - it looks good 🥲

#

im always like, this so bad!!!! I need to tweak this slightly. After it, i'm satisfied, but couple moments later, the cycle repeats

kind hatch
#

Fr, that is the life of a designer

fading drift
#

whats the best way of seeing if a player is connected to any server through velocity

remote swallow
#

By asking paper

fading drift
#

I wrote up a class for this if anyone wants to review it in the thread

orchid brook
#

Hi, I have a ConcurrentHashMap that stores ItemStack objects representing the contents of player backpacks. Each player has their own backpack.

I want to implement an auto-condense feature for the backpacks. For example, if a player has 9 iron ingots in their backpack, they will be replaced with 1 iron block. To achieve this, I plan to run a task every minute that iterates through the backpacks of all online players and performs the condense operation.

My question is: can this task be safely run asynchronously, or should it always be done on the main thread?

fading drift
#

most likely main thread

#

you could iterate through all the backpacks on an async thread

#

but then run any code that changes the player or the world on the main thread

ivory sleet
orchid brook
ivory sleet
#

Have you stress tested it to confirm whether it could cause lag?

In either way there’s probably a better way you could go about this, mainly splitting up this “big operation” to take place during several ticks during execution.

orchid brook
quaint mantle
#

is there a way to copy all resources to plugins folder?

summer scroll
#

How can I decide who's to show or hide from player list in the tab list, is it possible using spigot api or do I need to use packets?

barren peak
#

is there an easy way to make player's armor invisible withought removing it, storing it and then applying the defense that it would normally give because that sounds like a pain

summer scroll
karmic phoenix
#

Hey everyone, can a map communicate with another plugin?
For example: if I called a map(which is located in "Plugin1"), in "Plugin2", and I added events to prevent players in the map from breaking blocks in "Plugin1", and used "Plugin2" to add those players, would "Plugin1" use those changes?

#

I'm only asking because I've tried doing that, but "Plugin1" isn't reading those changes to the map that were made by "Plugin2".

merry cove
#

Yes, to both scenarios you are talking about a hashmap?

karmic phoenix
#

Yes.

#

But I've tried it already, it doesn't work.

merry cove
#

Can you explain how you're doing it since it's not working?

karmic phoenix
#
    public static void addPlayerToWar(UUID playerUUID) {
        FreeForAll.hasSpawned.remove(playerUUID);
        FreeForAll.isInGuildWar.put(playerUUID, true);
        Bukkit.getLogger().info("[FreeForAll] Added to isInGuildWar: " + Bukkit.getPlayer(playerUUID).getName());
        Bukkit.getLogger().info("[FreeForAll] Removed from hasSpawned: " + Bukkit.getPlayer(playerUUID).getName());
        Bukkit.getLogger().info("[FreeForAll] Current isInGuildWar map: " + isInGuildWar);
        Bukkit.getLogger().info("[FreeForAll] Current hasSpawned map: " + hasSpawned);
    }

    public static void removePlayerFromWar(UUID playerUUID) {
        FreeForAll.isInGuildWar.remove(playerUUID);
        FreeForAll.hasSpawned.put(playerUUID, true);
        Bukkit.getLogger().info("[FreeForAll] Removed from isInGuildWar: " + Bukkit.getPlayer(playerUUID).getName());
        Bukkit.getLogger().info("[FreeForAll] Added to hasSpawned: " + Bukkit.getPlayer(playerUUID).getName());
        Bukkit.getLogger().info("[FreeForAll] Current isInGuildWar map: " + isInGuildWar);
        Bukkit.getLogger().info("[FreeForAll] Current hasSpawned map: " + hasSpawned);

    }
#

I'm doing it like this.

#

And calling both methods in the other plugin.

proud badge
#

and what is the error

karmic phoenix
#

Also Plugin1 uses Maven while the other uses Gradle & Kotlin.

merry cove
#

ok, but you're sure the dependency is working?

karmic phoenix
#

implementation(files("D:/1- DEV/Guilds/FreeForAll-1.0.jar"))

#

Also just to be clear, I've never used Gradle nor Kotlin before.

merry cove
#

What happens when u use thesem ethods you posted?

karmic phoenix
#

I've disabled the "shop" command for players in the "isInGuildWar", and I've added them to that map using the Guilds plugin, but if I use /shop, I'm still able to.

#

The command exists in the FreeForAll plugin.

#
if (FreeForAll.isInGuildWar.containsKey(player.getUniqueId())) {
                player.sendMessage(ChatColor.RED + "You cannot shop while in a battle.");
                return true;
            }
pallid idol
#

?img

undone axleBOT
#

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

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

pallid idol
#

[09:09:53 INFO]: [CrystalRewards] false

wet breach
#

NTB?

#

do you mean NBT?

pallid idol
#

oh i mean the pbc

wet breach
#

well, crystalrewards is lowercase, where as you are using uppercase, I don't really use pdc but I am pretty sure its case sensitive

pallid idol
wet breach
#

your pdc data shows crystalrewards as being lowercase

pallid idol
#

yes

wet breach
#

but your code from what I see, shows it uppercase, not sure if it matters but I am pretty sure it does

pallid idol
#

i try thanks that i have not seen.

orchid brook
#

I have 96 wheat in a map,

public void removeItem(ItemStack item, int amount) {
    Integer existingAmount = items.get(item);
    int newAmount = existingAmount - amount;

    if (newAmount <= 0) {
        items.remove(item);
    } else {
        items.put(item, newAmount);
    }

    checkFull();
}
``` I do removeItem with a amount a 64, so now i have 32 wheat, but now when i redo this method existingAmount is null, the get method didin't find the key in the map, after debuging the map is not empty, i can see 32 wheat ... So i don't understand what is wrong is someone have an idear ?
upper hazel
#

spigot has GPL license 💀

#

but api not offical right?

#

uhh

#

im confused

sly topaz
#

and why is it surprising that Spigot is GPL-licensed

upper hazel
#

but this not what i mean

#

this is funny dont you think?

worldly ingot
#

If, for example, you threw that same ItemStack instance into an Inventory#removeItem() call, Bukkit will change the stack's amount

#

Every property, including amount, is calculated in ItemStack's hashCode() and equals() methods. They're generally pretty bad Map keys

#

If you don't need to check for a specific ItemStack's data and only care about the type, maybe a Material is better

pallid idol
#
 val uuid = NamespacedKey(CrystalRewards.instance.name.lowercase(Locale.getDefault()), "uuid")
 meta.persistentDataContainer[key, PersistentDataType.INTEGER] = args.args[0] as Int
 meta.persistentDataContainer[uuid, PersistentDataType.STRING] = UUID.randomUUID().toString()```

This is the creation code.

val state: TileState = event.clickedBlock!!.state as TileState
val container: PersistentDataContainer = state.persistentDataContainer
val key = NamespacedKey(CrystalRewards.instance.name.lowercase(Locale.getDefault()), "crystals")
val uuid = NamespacedKey(CrystalRewards.instance.name.lowercase(Locale.getDefault()), "uuid")
val haskey = container.has(key, PersistentDataType.INTEGER)
if (!haskey) CrystalRewards.instance.logger.info(haskey.toString())


This is the get code
but i get false in the console but the playerhad has the data.
#

maybe anyone can help me?

river oracle
pallid idol
#

I see

sly topaz
#

if you are using the custom block data lib, I think it partially handles that for you

#

only for blocks tho, not tile states

compact haven
#

can someone help me lmao

#

how is Material.matchMaterial("BIRCH_LOG") null for the breakpoint but a Material for the evaluator?

eternal night
#

missed api-version or something?

compact haven
#

server on 1.19 api_version set api_version: 1.13

#

I should probably update that but does Material.matchMaterial even rely on api_version?

glad prawn
#

u using api-version or api_version?

compact haven
#

ah definitely api_version by mistake

eternal night
#

spigot rewrites old plugin calls to matchMaterial iirc

#

so yea

compact haven
#

should probably recompile before restarting my debug server LOL

#

It works now, sorry LMAO

eternal night
compact haven
#

can I just say I love that we figured out debuggers and all

#

the whole System.out.println is at least 10x more mentally draining

sly topaz
blazing ocean
#

hotswapping >>>

sly topaz
#

being able to have some degree of freedom to hotswap things as well as stepping through code with a debugger is the most efficient workflow one can get

#

ideally, I hope for a time someone makes a hotswap agent plugin to actually make the whole thing more stable

blazing ocean
#

OH SHIT THEY FIXED IT

#

ah modmuss did

pallid idol
#

Hey my PlayerInteractEvent is double but it only works with the right click and the left click. what can I do about it.

remote swallow
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
pallid idol
#

thanks i will try

drowsy loom
#

Is there a way to cast or wrap a Slime to a Creature? It only extends Mob

chrome beacon
#

and why do you need to do that

quaint mantle
#

There is any way to like cache maps? And load/unload it when needed?

eternal oxide
#

MapMeta implements ConfigurationSerializable so can be saved/loaded

quaint mantle
#

like maybe using zip files

#

and unzip it to the worlds container

eternal oxide
#

You mean world not map then

quaint mantle
#

yeah sorry!

native nexus
#

I noticed that EntityRemoveEvent is currently experimental, is there an alternative event?

proper cobalt
compact haven
#

It's not crazy effective because if your breakpoint is in the main thread then it will crash the server after a few seconds but still much quicker than writing print statements because either way you'd need to recompile and restart the server

shadow night
remote swallow
#

you can run a debugger for mc without running the server in ur ide

proper cobalt
#

how

remote swallow
#

create a new remote jvm debug script, copy the arguments and add it to ur server start script, start ur server and run the debug config

proper cobalt
#

na

remote swallow
#

it takes like 2 min

proper cobalt
#

copy what arguments bro

remote swallow
proper cobalt
#

nah bro

blazing ocean
#

ok

proper cobalt
#

thats too much

#

what does it even do

river oracle
#

Let's me hack into your computer

#

Copy it so I can RCE

proper cobalt
#

aight can u set it up for me

#

on anydesk or sum shi

#

@river oracle that would be appreciated

eternal night
#

@river oracle

river oracle
compact haven
blazing ocean
#

yeah @river oracle

thorn crypt
#

Hey, how can I get the MFH_Globe head to put it in a GUI ?

#

and wich heads could I use to get flags like france, etc

river oracle
#

Head base and then set the player profile on the SkullMeta

thorn crypt
river oracle
#

Not the base64

river oracle
#

Yes

thorn crypt
#

okay thank you !

proper radish
#

I'm looking to optimize this chat handler. With around 250 online players, would it be efficient to clear the viewer list and then:

If party chat is enabled, add only up to 4 party members.
Otherwise, add only players in the same world?

    private final String COMMA = "<gray>: ";
    private final String PARTY_PREFIX = "<dark_gray>[<light_purple>Party<dark_gray>] ";
    @EventHandler(priority = EventPriority.HIGHEST)
    public void onAsyncChat (AsyncChatEvent e) {
        Player p = e.getPlayer();
        World world = p.getWorld();
// This is a Caffeine cache, providing fast and efficient access to user data.
        User user = UsersCache.getUser(p.getUniqueId());
        Party party = user.getParty();
        boolean isPartyChat = party != null && user.isPartyChat();
        // TODO: Change the default prefix color if needed
        String teamColor = (user.getTeam() != null ? user.getTeam().getId().getHexColor() : "<gray>");
        // TODO: Do i need to put a space before the message ?
        // case 1 -> [Party] Notch: Hi World! (isPartyChat)
        // case 2 -> <color>Notch: Hi World! (in game) , color=team's color
        // case 3 -> <gray>Notch: Hi World!
        Component displayPrefix = mm((isPartyChat ? PARTY_PREFIX : teamColor))
            .append(mm(user.getName() + COMMA));
        e.renderer((source, sourceDisplayName, message, viewer) ->
                displayPrefix.append(message)
        );
        /*
           Filter the message to only:
           if chat toggles to party -> party members
           otherwise to the sender's world players
        */
        if (isPartyChat) {
            var partyMembers = party.getMembers();
            e.viewers().removeIf(viewer -> viewer instanceof Player && partyMembers.contains(((Player) viewer).getUniqueId()));
        } else {
            e.viewers().removeIf(viewer -> viewer instanceof Player && ((Player) viewer).getWorld() != world);
        }

    }
worldly ingot
#

Seems fine. Nothing more you can really do to improve performance tbh. Probably doesn't need to have HIGHEST priority though

#

Also, : is a colon, not a comma :p

grand flint
worthy yarrow
#

Hey choco you ever have to do any custom generation stuff for your minigame impls?

worldly ingot
#

That's confusing. Highest is called last*

proper radish
worldly ingot
worthy yarrow
#

really??

worldly ingot
#

Yes. We have a build team lol

worthy yarrow
#

Wow that's actually so surprising

#

dang I was hoping you knew about perlin noise and wfc kek

grand flint
worldly ingot
#

I mean perlin noise isn't particularly complicated. It's just a math function that gives you smooth waves

grand flint
#

ull get all sorts of generation

worldly ingot
#

If you want more than just simple perlin noise, you have to generate other types of noise that you can stack on top of one another

worthy yarrow
worthy yarrow
sly topaz
#

you don't implement it in any other way than it is described

#

you just tweak the params to generate the type of noise you want

#

that said, what are you trying to do exactly, world generation?

worthy yarrow
#

of sorts... course generation for disc golf and I was thinking perlin noise looked nice for some y axis generation (hills and what have you)

sly topaz
#

doesn't sound too complicated, just slap a chunk generator and copy a perlin noise function that works with minecraft blocks and you're good?

worldly ingot
#

Like I said, it's not a matter of implementing perlin noise differently. It's applying noise with different input parameters and laying them on top of one another

sly topaz
#

perlin noise has been implemented in MC before, probably the server itself has an impl even

worthy yarrow
#

I'll read more into it, I've only recently gotten the wfc impl to a point that looks decent so

worldly ingot
sly topaz
#

what does wfc mean

worldly ingot
worthy yarrow
#

wave function collapse

#

It's a procedural generation algorithm

#

(at least in the cases it's most used for)

worldly ingot
proper radish
# grand flint lol ok

doesn't setting it to HIGHEST makes sense ? so it wont modify the event before other plugins like litebans
so if the player muted and I perform all the processing (like filtering viewers and formatting) then the message get cancelled it could negatively impact performance

worthy yarrow
#

This was one of the nicer gens

sly topaz
sly topaz
#

perlin noise + some custom structure placements for the holes and whatnot of the golf course should be good enough

worthy yarrow
#

Well

sly topaz
#

I thought I had seen all bukkit had to offer yet, guess not

worthy yarrow
#

When you say custom I feel like you mean just pre designed maps (in the sense of obstacle placement) right?

#

My whole point for this generation stuff was to implement an entire randomized course generator in that the course tiles are randomized as well as the actual obstacles that are placed perhaps you get bored of the first 9 courses that are genned with the plugin or something, just generate some more ya know

#

I've probably been looking at too many game impls of world gen and would be better off turning this whole project into an actual game kek

sly topaz
#

I mean, there is no reason for the obstacles/hazards to be procedurally generated per se

worthy yarrow
#

Well there are constraints ofc

sly topaz
#

just have it be some kind of structure with modifiable params that make it distinct enough from each other

worthy yarrow
#

The tiles you see in that pic are fairway, obstacle, water, tee (start), and pin (end)

worthy yarrow
sly topaz
#

it will, that's how every generator in a game works

#

if you don't feel it is random enough, you just add another parameter

worthy yarrow
#

Yeah that's true

#

Also that pic isn't the best considering my tile sizes are 16x16

#

I was gonna try and do some blending of sorts

sly topaz
#

I mean, if you already got that working then it's probably best you continue with that, as you will have a harder time adapting your code now

#

I definitely think you are making your life harder with this though, lol

#

if anything, I'd recommend looking outside of minecraft for procedural generation tutorials, just game dev in general, will give you a better outlook on what it entails

#

afterwards you'll just have to figure out how to apply that knowledge to the constraints of chunk generators

worthy yarrow
#

Yeah that's fair enough, I will see what I can do with what I have and maybe rewrite it later

#

at least it's somewhat decent right now

proper radish
#

Is there a readable way to store the state of a block in a YAML file?

Currently, I'm storing generator locations in the format world,120.50,120.0,-860.5, and each generator has an associated image (item frame). I need a method to store both the block's state and the location of the item frame in the YAML file. Should I directly store the block state, or i need to encode it, perhaps using Base64? Here’s what I have in the config:

Generators:
  1:
    Type: IRON
    Location: -11,65,-12
    Item-Frame: # THATS WHAT I AM TALKING ABOUT
    Image: #iron.png
#

also can i just store the facing like NORTH, SOUTH, EAST, WEST.
or this is wont work ?

young knoll
#

You can just store the facing

proper radish
#

How can I work with images in item frames (not GIFs)? Is there a library or tool to simplify this ?

young knoll
#

Like a map?

#

MapRender has some stuff in it

neat wolf
#

Hi
is there any kind of javadoc/documentation of the NMS remapping by spigot? I can't find much information on how things work in the latest versions like NPCs, ... I was still working on obfuscated mojang 1.17 last week 😅

blazing ocean
#

There are no JD for obf or mojmapped NMS hosted publicly as it would be illegal

#

though just use citizens

blazing ocean
shadow night
#

I'll host it in russia so they can't do anything

blazing ocean
#

smart

vocal cloud
#

Until they trace it back to you

blazing ocean
#

raydan yours includes parchment right?

shadow night
blazing ocean
#

parchment for sploon when?

shadow night
shadow night
fading drift
#

is there a way to use plugin message channels to check if a player is online by UUID?

fading drift
#

doesnt really answer my question

#

do I need to use PlayerList to get names of all players

#

and then run UUIDOther on all of those player names

#

and then compare uuids?

rough drift
#

Try GetServer and check the reply?

fading drift
#

what

#

GetPlayerServer?

#

that takes a username not uuid

rough drift
#

You can probably use OfflinePlayer#getName

fading drift
#

I want to be able to support messaging a player from a server that the player has never joined

#

so offlineplayer wont return a name

#

at least thats how I interpret OfflinePlayer to work

rough drift
#

it should do a server lookup, if it doesn't, use this GET https://sessionserver.mojang.com/session/minecraft/profile/<uuid>

brittle geyser
#

I am creating a world then reload the server and when i am trying to get this world it returns null

sly topaz
sly topaz
fading drift
#

yeah I am atp

#

I'm thinking I should write some sort of system where I have like a NetworkPlayer object that stores uuid, name

#

and itll just get it from my velocity plugin when requested

sly topaz
#

that exists inside velocity itself

fading drift
#

I honestly completely underestimated how much effort it would be to split my plugin in 3

sly topaz
#

instead of relying on bungeecord built-in channels, you can just make custom channels for any specific information that you may want

fading drift
#

yeah I'm doing that now

#

but I don't want to create like a channel for name, uuid, and any other info like

#

what if I create my own object that will just be transferred through channels

sly topaz
#

I mean, you create a channel for the plugin in question, then subchannel for specific requests

fading drift
#

sorry its hard to explain what I mean

sly topaz
#

I get what you mean, you just want to transfer the whole thing instead of requesting specific information each time

fading drift
#

I'm basically just having to rewrite my message manager that handles replies and shit

#

and I created my own velocity plugin to handle sending messages by uuid

#

and now I'm having the issue where I display to the sender the player name of the reciever, however if theyre on a different server the only way I can think to get their name is to look it up from velocity

#

and theres just so many calls and the code is disgusting

brittle geyser
sly topaz
brittle geyser
#

ok

sly topaz
#

as long as the world exists, it'll just load it instead of creating a new one

brittle geyser
#

weird but ok

sly topaz
#

it's because Bukkit doesn't manage any other worlds than the default ones

#

you need to save the worlds you loaded to a file, then load them up again on server startup or whenever you want

sly topaz
#

ideally, you would have all this kind of information in a database, and just query the database itself instead

fading drift
#

so like

sly topaz
#

that's usually how people go with this since it is easier than setting up a system to request information from a specific backend at a time

fading drift
#

cache player name and uuid in a database when they join thru velocity

#

and then in plugin just query database

sly topaz
#

basically

fading drift
#

whats the downsides

sly topaz
#

depending on the information you store, querying to the database won't be as immediate which ultimately leads to adding an instant access cache layer, and just have the database for persistence

#

that's often done with redis or some kind of pub/sub system as you've experienced

fading drift
#

far out

sly topaz
#

there are other ways to go about that, but for information like this it should be fine to just query the database and have a local cache with caffeine

fading drift
#

whats caffiene

sly topaz
#

a local cache library, it's the successor to Guava's cache basically

fading drift
#

I see

#

honestly ur right I might give up on this plugin message shit for uuid and name

sly topaz
#

other way to go about it and that people seem to have an easier time with is just loading everything from database on server startup

fading drift
#

so pointless

#

well I'm thinking like the database would only contain the amount of entries as online players

#

would I then have to get velocity to tell each plugin when a player joins so it can add it to the cache

#

or will the cache automatically refresh that info or something

sly topaz
#

nah, you'll ultimately have to save the join/leave information in the database, then query it from the backend server for this kind of information

#

this is why people use distributed cache layers like redis, so they don't have to worry about the updating