#help-development

1 messages · Page 112 of 1

slate mortar
#

you want to show specific text tied to specific players?

quaint mantle
#

alrighty just had to add an extra (

slate mortar
#

oh my

#

welcome to packets i guess then

sacred mountain
#

i thought placeholderapi had a sign module

#

no?

slate mortar
#

idk never used it

#

maybe

thorny marsh
#

But dont know which packet

quaint mantle
#

ok but here comes the actual problem so as you can see

``` there is an edition number, and it needs to be changed every time a space helmet is given to a player by an admin how do I do this now
sacred mountain
#

can u even get big_dripleaf in survival

slate mortar
vital sandal
slate mortar
#

testing i guess

thorny marsh
slate mortar
#

i don't use packets, so actually no idea

#

i only mess with custom packets, where i just use the normal messaging channel

severe marsh
#

How can I turn this data into ItemStack?

==: org.bukkit.inventory.ItemStack
    type: TRIPWIRE_HOOK
    amount: 9
    meta:
      ==: ItemMeta
      meta-type: UNSPECIFIC
      display-name: "\xa7f123123 key"
      lore:
      - "\xa77Use this to open \xa7f123123\xa77!"
      ItemFlags: !!set
        HIDE_ENCHANTS: null
        HIDE_ATTRIBUTES: null
slate mortar
#

ItemStack.deserialize(map); i guess

chrome beacon
#

Or just getItemStack

#

Because that exists

safe hatch
#

I have a question. I know that you can put JsonObjects into a Json config with multiple things in them. But how can you get these things in the JsonObject from the config?

tidal yacht
#

Is this legal while loop in event?

public void onPlayerJoin(PlayerJoinEvent event){
    while(true){
        system.in.println("test");
    }
}
chrome beacon
#

That will crash your server

slate mortar
#

what the

onyx fjord
#

💀 thats not how you do events

#

?xy

undone axleBOT
tidal yacht
onyx fjord
#

what do you want to do

tidal yacht
onyx fjord
#

what value what

iron glade
#

why that

onyx fjord
#

just tell us whats your end goal

tidal yacht
#

like thirst plugin

onyx fjord
#

?

iron glade
#

idk what you mean

onyx fjord
#

you want to give palyers hunger on join or what

tidal yacht
#

I want subtract value from player data if player during inside the server

onyx fjord
#

what data

iron glade
#

and why do you need a loop for that

tidal yacht
#

because, there is no event or what is that if the player during inside the server

onyx fjord
#

playerjoinevent is ran when player joins the server

remote swallow
#

Couldnt you just add there name to a hash map when they join and run a scheduler on the names in the hashmap then remove the name from the hash map when they leave?

opal oasis
#

Does anyone know how to replace material names from "_" to ""

iron glade
#

you literally replace _ with " "

opal oasis
#

yeah... how

iron glade
#

well

#

String.replace

onyx fjord
#

does VillagerAcquireTradeEvent return the number of trade that gets added?

#

i need 2 override it

onyx fjord
tidal yacht
sacred mountain
#

learn java first ig

#

spigot for intermediate ish

#

maybe even for beginners but you gotta know the basics

opal oasis
#

thats what i get

sacred mountain
#

you gotta do '_', ''

#

if you're using char

#

not '_', ""

#

but then you'll get a char literal error

#

so use "_", ""

opal oasis
#

...

torpid sapphire
opal oasis
#

i forreal just did String.replace("_", "");

iron glade
#

show your method

sacred mountain
#

bruf=h

#

not String.

#

unless thats a placeholder

onyx fjord
opal oasis
#

someone told me to do string

sacred mountain
#

for what u have

onyx fjord
#

shall not happen

iron glade
#

bruh

sacred mountain
#

bruh

#

u cant just do String.replace()

#

it's object oriented

iron glade
#

you have a string variable with some name

onyx fjord
#

but _ is a character

opal oasis
#

WELL I ASK FOR A REASON DON'T I

remote swallow
#

we dont know your string name

iron glade
#

and you use .replace on that variable

#

basic java

#

?learnjava

undone axleBOT
sacred mountain
#

stringVariable.replace("_", "");

opal oasis
#

then you should use (stringname) i would suggest

iron glade
#

no

sacred mountain
#

String stringVariable = "this_is_dumb";

iron glade
#

you should know that

#

at least learn some basics

opal oasis
#

i know some basics

onyx fjord
iron glade
#

not to be rude but it makes it easier for yourself and for us trying to help you

opal oasis
#

but both doesn't work

iron glade
#

then show your method

opal oasis
#

Material item = Material.getMaterial(args[0].toUpperCase()).name().replace("_", "");

torn shuttle
#

ay I now have my own maven repo (or gradle, if you are a cultured person)

onyx fjord
#

Material isnt a string?

iron glade
#

try .toString() instead of .name()

#

I never use name on material

onyx fjord
#

^ i wouldnt use item as var name for Material

#

i generally reserve it to ItemStack

iron glade
#

also you have a material variable

torpid sapphire
iron glade
#

not a string

onyx fjord
#

got it

#

#getRecipeCount

iron glade
onyx fjord
#

but

#

is getRecipeCount including the one that got added in event

#

or no

torpid sapphire
#

i’d assume no but you’d have to test that

#

the trade shouldn’t exist yet while the event is firing

onyx fjord
#

can i somehow inject into minecrafts trading selector to add my own enchant book?

#

gotta make is as vanillish as possible

torpid sapphire
#

yeah you can check if it’s an enchanted book and if yes, add your own enchant selector logic

#

did something similar yesterday

#

instead of adding an enchant i removed mending

onyx fjord
#

but then i have to do random percentage no?

#

idk how vanilla does it

torpid sapphire
#

yeah

#

Enchantments.values gets you a list of all enchantments

#

select a random one

onyx fjord
#

wait does Librarian give random enchant from registered ones or its hardcoded

torpid sapphire
#

i’m not sure actually

onyx fjord
#

cuz i register mine

#

making it no problem

mellow pebble
#

Umm i have this problem with this piece of code it should grab material by string that is being gathered from config.yml and then it should make it as ItemStack but it appears that material is null and i really dont know why since i get this in my console when i try to print out values that are gathered from config

#

this is how i know material is being null

#

even though it shouldnt ?

iron glade
#

Did you print out the config reason string ?

crimson scarab
#

how can i get the angle towards a point

mellow pebble
#

config.getString("Reasons." + reason + ".Item")

#

i printed this

#

and i got those items

#

and if i print

#

config.getString("Reasons." + reason)

#

i get reasons

#

it is these lines like Anti-Knockback

#

dly

#

fly

#

speed

sterile token
# mellow pebble

So you have to get each memory Section as a ConfigurationSection

mellow pebble
#

i printed 2 things

#

reason variable

#

which gives me that name

#

Fly

#

Speed

#

Fast Bow

#

X-Ray

#

this second thing is totaly something random

#

that i printed

remote swallow
#

send config.yml, might help in the diagnosis

sterile token
#

I dont understand can you explain more detailed

mellow pebble
#

just to see where i might be making mistake

onyx fjord
#

Is anybody aware how do i add trade to trade pool of a villager?

mellow pebble
#

?paste

undone axleBOT
mellow pebble
#

Reasons key has bunch of reason keys

#

each reason key has item slot and lore

#

lore is still not added ofc i want to just put item in inv first

sterile token
#

So you have to just play around with ConfigurationSection#getKeys(true) and with false

mellow pebble
#

i got those "Fly" "Speed" "Fast Bow" words

#

by printing

#

config.getConfigurationSection("Reasons").getKeys(false)

#

and it is correct

sterile token
#

Lmao you are not explaning fully detailed

#

What your point!

#

Its imposible to help if you dont detail what you need

mellow pebble
#

agh i so okay i have a list of reasons "keywords" that im looping trough with for loop and for each reason in that list i want to make ItemStack but it seems to be giving null Material somehow

#

i gather material by combining names of keys from config.yml file

#
ItemStack reasonItem = new ItemStack(Material.getMaterial(config.getString("Reason." + reason + ".Item")));
#

this is the line that is gathering material by string

#

and string is gathered from config.yml file

#

but i still get Material is null even though i am gathering item from config correctly

sterile token
#

Please send full config file and code you are using

#

Vía paste

#

?paste

undone axleBOT
mellow pebble
#

?apste

#

full code

#

like every gui

#

every event

#

every command ?

sterile token
#

Oh no

mellow pebble
#

or just this part ?

sterile token
#

I mean the file part

#

Where you are having this issue

mellow pebble
sterile token
#

Because as far I understand you are getting a null item from the Section

mellow pebble
#

error from console is on end

mellow pebble
#

it throws error on line where i create ItemStack variable because material is null

#

even though i wrote correct path to string from config

sterile token
#

Mate

#

I figure the issue

#

You have wrong path

mellow pebble
#

HOW

sterile token
#

You are using config.getString("Reason." + reason + bla )

agile anvil
#

"Reasons" and not "Reason

sterile token
#

Yeah

#

Thst

#

You are using Reason instead of Reasons

mellow pebble
#

nope

#

still

#

same error

sterile token
#

As the path is null, ítemstack is null

agile anvil
#

Could the keys have spaces in yml config ?

sterile token
mellow pebble
sterile token
#

Keys musnt have spaces

mellow pebble
#

i changed it to Reasons

agile anvil
#

That's the problem then

mellow pebble
#

still same error

agile anvil
#

Remove the spaces

mellow pebble
#

from where ??

#

where do you se spaces

onyx fjord
#

whats the method to get villager max stock

sterile token
#

I think that keys cannot contains spaces

#

Because then you cannot get them

agile anvil
#

"Fast Bow", "Kill Aura.." ...

sterile token
#

He is using spaxes for keys

#

Rolyn

mellow pebble
#

i had that before

#

and it worked

#

i had this working yesterday

solid cargo
#

ok so why the hell

mellow pebble
#

it was not a problem with spaces

hazy parrot
#

Keys should be able to have spaces

sterile token
#

Dont use keys with spaces

solid cargo
#

why doesnt getMaxAge work. i remember it existing

#

way i get ageable btw

mellow pebble
#

i tried now again

#

still not working

sterile token
#

CALM down

mellow pebble
#

even tho

#

i removed spaces

mellow pebble
#

it is not because of it

solid cargo
#

idk just git gud

agile anvil
#

What's the line with the NPE ?

mellow pebble
#

i tried this and it worked yesterday

#

now it wont work

solid cargo
#

did you comment something important out maybe?

mellow pebble
agile anvil
#

@mellow pebble What's the line with the NPE?

quiet ice
#

Let me guess: Clicking outside the inventory?

mellow pebble
#

omg @quiet ice you are smart

#

can you help me

#

lol

agile anvil
solid cargo
fiery prairie
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

mellow pebble
solid cargo
#

ok boomers: expecting: getMaxAge() to work

fiery prairie
solid cargo
#

but i provided the info needed

fiery prairie
#

not even the error

quiet ice
quiet ice
solid cargo
iron glade
mellow pebble
#

if it is on Reason

iron glade
#

ReasonS

mellow pebble
#

no

#

no

#

still not working

iron glade
#
  Kill Aura/Forcefield:
    Item: "IRON_SWORD"
    Slot: 0
    Lore:
      - "bla bla"
      - "blah blah"
      - "yeah yeah"
  Anti-Knockback:
    Item: "LEAD"```
#

if that's your config

mellow pebble
iron glade
#

you're using config.getString("Reason." + reason + ".Item")));

mellow pebble
#

and no it is not because of ReasonS

#

i fixed it

#

still doesnt work

iron glade
#

still not working?

mellow pebble
#

still Material is null

#

🤷‍♂️

quiet ice
#

It does not make much sense though, you are not directly invoking Object#requireNotNull

#

Blame IJ I guess

#

Eclipse would never do that and tell you the exact reason of the NPE

eternal night
iron glade
#

Eclipse

quiet ice
#

Since you are using such an absolutely stupid IDE we cannot help you further

iron glade
#

Why talking for everyone

quiet ice
#

Turn off null anotation enforcement and use Java 15+ NPEs and then we can talk

fiery prairie
quiet ice
#

IJ ofc

eternal night
quiet ice
#

Ofc it is a user error, but let's not blame people

fiery prairie
#

and once again, I'm disappointed in humans

quiet ice
#

hey, eclipse is so primitive that it would never insert bytecode in your code

agile anvil
mellow pebble
#

AHAHAH

quiet ice
#

Thanks to it we do not know what part of Material.getMaterial(config.getString("Reason." + reason + ".Item")); is null

agile anvil
#

What does it return then ?

eternal night
#

you can properly disable these runtime enforcements

quiet ice
#

Yeah you cna

mellow pebble
eternal night
#

beyond that, what do you mean you don't know what part of that is null ?

iron glade
#

are you exporting to right place

agile anvil
quaint mantle
#

?paste

undone axleBOT
mellow pebble
#

this is literally what config.getString("Reasons." + reason + ".Item") prints out

quaint mantle
mellow pebble
#

so it souldnt throw an error "Material is null"

cobalt thorn
#
    @EventHandler(
            priority = EventPriority.LOW
    )
    public void onDeath(final PlayerDeathEvent e) {
        Meridiana.getInstance().getLogger().info(e.toString());
        if(e.getEntity().getKiller() != null) {
            if(e.getEntity().getKiller() instanceof Player) {
                if(e.getEntity() instanceof Player) {
                    ItemStack type = new ItemStack(Material.PLAYER_HEAD);

                    SkullMeta meta = (SkullMeta) type.getItemMeta();
                    meta.setOwner(e.getEntity().getName());

                    type.setItemMeta(meta);

                    e.getEntity().getWorld().dropItem(e.getEntity().getLocation().add(0,1,0), type);
                }
            }
        }
    }

in case for /kill what would be the instanceof?

chrome beacon
#

/kill deals a lot of void damage

remote swallow
cobalt thorn
quaint mantle
#

83

quaint mantle
cobalt thorn
#

i need only in case of player or /mill

agile anvil
mellow pebble
mellow pebble
iron glade
#

there's no setInt

chrome beacon
mellow pebble
#

1.19.2 is default that intellij sets for me

agile anvil
#

Try it then we'll see

chrome beacon
#

API version (in the plugin.yml) doesn't care about minor versions

fiery prairie
chrome beacon
#

Maybe they're talking about the maven dependency ??

#

If so keep that set to 1.19.2

fiery prairie
#

Oh yea possibly

mellow pebble
#

and still the same error

iron glade
#

If you hardcode some material it doesn't throw a npe, right?

mellow pebble
quaint mantle
iron glade
mellow pebble
quaint mantle
mellow pebble
#

that works

#

normally

#

without any problems

quaint mantle
# quaint mantle https://paste.md-5.net/ejocimihak.java

Cannot resolve symbol 'editionNumber' : line number 52
'getPlugin(java.lang.@org.jetbrains.annotations.NotNull Class<org.bukkit.plugin.java.JavaPlugin>)' in 'org.bukkit.plugin.java.JavaPlugin' cannot be applied to '()' : line number 20

iron glade
#

and printing config values also does return something, weird

mellow pebble
#

IRON_SWORD

#

SUGAR

#

DIAMOND_SPADE

#

POTION

#

and such things

chrome beacon
#

Could you show the code causing the error

iron glade
chrome beacon
quaint mantle
#

but I have saved it as a file

chrome beacon
#

getPlugin requires a class

#

Also editionNumber doesn't exist in JavaPlugin

quaint mantle
#

no no its a file

#

OH

#

then what do I do?

chrome beacon
#

Give getPlugin the main class or use di

#

?di

undone axleBOT
quaint mantle
#

hm

#

but here is da thing

#
 ChatColor.DARK_GRAY + "Edition: #" + (plugin.editionNumber++),```
#

I need the number to be presented here

iron glade
#

What's the meaning of editionNumber?

quaint mantle
#

the ```java
(plugin.editionNumber++),

iron glade
#

do you want the plugin version?

quaint mantle
#

no no

#

oh I didnt explain

#

so when an admin does /spacehelm, it give a helmet to a player with the lore of an edition number

#

and it changes everytime like a + 1 when a new one is given

iron glade
#

I'd just use some variable and only save it on disable to config

quaint mantle
#

wym

odd wedge
onyx fjord
#

(minecraft:wisdom is an unknown enchant)

iron glade
# quaint mantle wym

You have some accessible variable you increase every time someone runs the command, and onDisable you save it to file

#

or if you really want you could also do it like every time someone runs the command

#

Or did I get you wrong

onyx fjord
#

"Registered wisdom enchant." does however print

quaint mantle
#

but then I want the number to be displayed in the lore

iron glade
olive lance
#

@tender shard with your ArmorEquipEvent when called and you check what armor the player is wearing it will say they are not wearing a full kit when they just put on the last piece

quaint mantle
odd wedge
quaint mantle
#

also who dat dude in ur pfp

onyx fjord
onyx fjord
iron glade
#

okay, so you have an int variable, in onEnable() you set it to whatever is saved to file, then every time someone runs the command you give them the item with the value of that int variable in its lore and increase that variable by one, also save it to file

quaint mantle
#

bro typing for to long

onyx fjord
#

are you trolling or what

quaint mantle
#

who

#

me?

iron glade
odd wedge
#

Explain your problem

odd wedge
#

And what is editionNumber

quaint mantle
# odd wedge And what is editionNumber
private static JavaPlugin plugin;
    FileConfiguration config = getConfig();
    int editionNumber;
    
    public static JavaPlugin getInstance() {
        return plugin;
    }

    @Override
    public void onEnable() {
        plugin = this;
        
        config.addDefault("editionNumber", 1);
        config.options().copyDefaults(true);
        this.saveConfig();
        editionNumber = config.getInt("editionNumber");
#

this

#

a config file

iron glade
#

an int*

odd wedge
#

Send your main file

#

?paste

undone axleBOT
river oracle
#

Return your main class

odd wedge
#

Even then editionNumber should be private

#

Use getters and setters

river oracle
#

Also use di :P

#

?di

undone axleBOT
iron glade
#

private static DctrSpaceHelm plugin; instead

#

but use di instead

agile anvil
odd wedge
river oracle
#

Even with most api methods di should be used

odd wedge
#

Not really, always depends on what you're doing.

river oracle
#

There really isn't ever a reason to not use it outside of creating a singleton class

odd wedge
quaint mantle
#

what

#

im here

#

im here

quaint mantle
odd wedge
#

No.

quaint mantle
#

fuck

odd wedge
#

?di

undone axleBOT
brittle loom
#

Hello, does anyone know why heads don't get placed properly in 1.8 when using the SkullCreator library? (https://github.com/deanveloper/SkullCreator/blob/master/src/main/java/dev/dbassett/skullcreator/SkullCreator.java) I'm using this method to create the head final Block skullBlock = this.block.getRelative(BlockFace.UP); SkullCreator.blockWithBase64(skullBlock, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGNjNzI1NzhhNjBjMGViMWEzZmEzODFhYTYyMmEwYzkyNzZkYTdmOTU4YWU5YTBjNzFlZTQ4ZTc3MWZiMmNjNSJ9fX0="); If anyone could help me fix this issue, it would be much appreciated.

GitHub

An easy to use library to create player skulls in minecraft - SkullCreator/SkullCreator.java at master · deanveloper/SkullCreator

odd wedge
#

read that

river oracle
#

1.8 💀

quaint mantle
#

I think I have done it

odd wedge
odd wedge
river oracle
#

I'm sure there is one insane mf around who will help with 1.8

odd wedge
#

I would but it's too outdated

abstract sleet
#

Probably why 1.8 devs still exist 😁

manic furnace
#

How can I make a book_and_quill ItemStack? Because the Material is deprecated

rough drift
odd wedge
#

Deprecated doesn't mean that you can't use it

#

Read the javadocs

abstract sleet
odd wedge
#

?jd spigot

river oracle
#

If it's for removal it will point you where to

abstract sleet
manic furnace
#

No it doesn

abstract sleet
#

In my opinion, the networks which ‘require’ running 1.8 have their own experienced developers already

abstract sleet
manic furnace
#

1.13

abstract sleet
#

Why?

river oracle
#

1.13 weird version

manic furnace
#

support for lower versions

agile anvil
#

Spigot is backward compatible

abstract sleet
#

Ok

agile anvil
#

So switch to 1.19

odd wedge
#

Check the javadocs for 1.13 then

river oracle
abstract sleet
#

Just don’t use 1.14 or newer API and you’re fine

river oracle
#

I'm pretty surr it's only forwards compatable

agile anvil
fiery prairie
#

so i have an EntityExplodeEvent, i checked if getType is ender_crystal, now how would i check if the cause of explosion was a player?

manic furnace
abstract sleet
river oracle
agile anvil
agile anvil
abstract sleet
#

Lot of effort to support 1.9-1.17 relative to how many servers still run it

vital sandal
#

is there anyway to track player left_click_block_event in adventure mode ?
i tried using animation tracking but it got some problems when right click

manic furnace
#

So how do you create a Book and Quill in 1.19?

river oracle
#

They weren't removed from minecraft so you should be good to go

abstract sleet
manic furnace
#

Ok but why are they than deprecated

river oracle
abstract sleet
#

Are you using a LEGACY_ constant

river oracle
#

Look

manic furnace
#

yeah

vital sandal
river oracle
#

Player#getGamemode iirc

manic furnace
vital sandal
#

no interact event is send when player left click in adventure

abstract sleet
manic furnace
#

Oh writable book

abstract sleet
#

There ya go

eternal oxide
#

Book and quill is now WRITEABLE_BOOK I bleieve

manic furnace
#

Ok thanks

abstract sleet
onyx fjord
vital sandal
agile anvil
vital sandal
#

left click air is still working

agile anvil
#

Just debug the interact event and output the action name. Then test

abstract sleet
#

I have no idea, the only place i would use it is a lobby. I don’t have enough time to run a server network 😁

river oracle
#

Idk why they just don't

#

You could try to dig through nms and figure out why but I'm clueless

kind hatch
river oracle
#

Unless it's changed since I last used a wrapper

kind hatch
#

Well, custom enchantments are weird. Haven't messed with them in a while, but there are two approaches.

The lore approach - Create custom enchantment logic in different classes and activate it if the item lore contains the specific string relating to it.
The proper integration - Use the enchantment API to add in custom enchantments.

onyx fjord
#

is it normal that my enchant isnt shown in /enchant tho

quiet ice
#

yes

onyx fjord
#

why that

river oracle
#

Look at nms and try to figure it out lol no clue

quiet ice
agile anvil
#

enchant is a nms command

kind hatch
quiet ice
#

Although bukkit did rewrite a lot of commands, so it could be a bukkit command actually

agile anvil
#

So since minecraft wasn't designed to be edited, enchant will only display the mc enchants

quiet ice
#

But I do not think so

onyx fjord
agile anvil
onyx fjord
#

no result

quiet ice
#

If you want to register minecraft enchantments, you technically should register them to the bukkit enchantment registry AND the nms enchantment registry. But noone does that

quiet ice
onyx fjord
#

what

kind hatch
onyx fjord
#

bruh

#

why is there so much fuckery

river oracle
#

Enchants!

#

Improve the api in bukkit Kasper lol

quiet ice
#

Anvils are hard to implement correctly if you do not register them to any registry

quiet ice
river oracle
#

I'm aware but you could improve the api to make impl less weird then again that's a lot of effort

onyx fjord
#

😴

#

maybe any external libs

quiet ice
#

It must be huge efforts since not even the paper team wishes to do anything at a large scale with it

#

Although paper has a noticeably better implementation - but there are still some things you'd rather not want to deal with that are present

onyx fjord
#

im running spigot

quiet ice
#

Yeah good luck.

echo basalt
#

I wonder how awful it'd be if we just used reflections to unlock registries

#

by injecting mutable collections n all

quiet ice
#

Most people already do that with the bukkit ench registry

echo basalt
#

I mean nms registries

quiet ice
#

I mean you could, but I am not certain if there are any advantages to that

echo basalt
#

crashing the server seems like an advantage

quiet ice
#

It probably will not crash the server

#

At the very least it would crash the client

tardy delta
iron glade
#

Nobody:
FifteenBrush:
Sending random pics from code without context

tardy delta
#

i dont know who that is

odd wedge
#

.next.next.next.next.next.next.next

kind hatch
#

Mfw no array. 😢

void isle
#

Do you use an API to create Animated Scoreboard ?

quiet ice
tardy delta
#

lol

quiet ice
#

(real thing btw)

quiet ice
abstract sleet
#

You could?

midnight glade
#

any idea why

#

player.teleport(player.getBedSpawnLocation());

#

returns player not sleeping error

lost matrix
#

Send the exception pls

odd wedge
#

because you haven't set their bed or they haven't slept probabl

#

y

tardy delta
#

its nullable

eternal oxide
#

getBedLocation().. They won't have a bed spawn location if they are not in bed

lost matrix
tardy delta
midnight glade
#

Caused by: java.lang.IllegalStateException: Not sleeping
at com.google.common.base.Preconditions.checkState(Preconditions.java:502) ~[guava-31.0.1-jre.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer.getBedLocation(CraftPlayer.java:1387) ~[paper-1.19.2.jar:git-Paper-135]
at com.fuckingidiotmc.fuckingidiotmc.main.onCommand(main.java:112) ~[FuckingIdiotMC-0.0.1-SNAPSHOT.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]

#

I have slept

#

the command works just fine while in the bed

#

get bed location also returned same error

lost matrix
midnight glade
#

if(player.getBedLocation() == null) {

lost matrix
#

No. this makes no sense.
Dont modify the code, compile right now, upload the plugin, cause the error again
and then send the full exception plus the whole method that caused the exception

#

Ah getBedLocation will throw this exception

#

I thought it was still getBedSpawnLocation

midnight glade
#

do I change getbedlocation to get spawn location for the null issue

abstract sleet
#

Oh. Wow, that tricked me too.

lost matrix
midnight glade
#

ooo

#

lemme recompile

abstract sleet
midnight glade
#

I just want to teleport the player back to their respawn point with a charge

abstract sleet
#

I wonder if that’s a different method considering the respawn point block added a few versions ago

#

Respawn Anchor iirc

tardy delta
#

fuck just saw i sent the wrong method

midnight glade
#

switching 112 to getbetspawnlocation fixed everything

tender shard
#

of course the event is called BEFORE they equip the armor

olive lance
#

is there a way to have it called after?

lost matrix
tender shard
#

wait a tick

#

or listen on monitor, check if it's cancelled, and if no, you can assume that it was equipped

lost matrix
#

I really think Spigot needs a postEvent(Runnable) method in the Event baseclass so that you
can do those things in the same tick. Delaying a tick feels so fragile.

worldly ingot
#

Problem is that that's so extremely difficult to implement because when those should get run is entirely dependent on the event implementation

worldly ingot
#

We would need to account for every single event call in NMS to invoke them

echo basalt
#

I mean

#

does it really

echo basalt
#

Because callEvent is a thing

#

and it's always called

#

so like

lost matrix
#

I see how this is quite a bit of work because every event has a ton of logic after it.
But i think this would be a very decent improvement to the whole way people can use the api.

echo basalt
#
boolean call = !(event instanceof Cancellable) || !((Cancellable) event).isCancelled();

if(call)
  postEvent(event)
#

type thing

worldly ingot
#

No I get that. But as an example. PlayerItemConsumeEvent. What if it's a potion? Sure you can run it after the event is called, but the potion still hasn't been applied by the time it's been called

echo basalt
#

but it would break the concept a bit ig

worldly ingot
#

The item actually hasn't even been consumed by that point either

#

And that's just one example

echo basalt
#

yeah I see the issue

worldly ingot
#

The proposed solution would be equivalent to just adding a MONITOR event listener

#

So again, depends on the event and would have to be implemented on a per-event basis

#

Per-event-call basis, actually

echo basalt
#

or you can just delay it by a tick and call it a day

lost matrix
#

Yeah you would have to decide for every event individually when all parameters of an event are fully used up.

echo basalt
#

¯_(ツ)_/¯

tender shard
#

i still dont see the issue though, because in the armor equip event you just do getNewArmorPiece() and that's it

lost matrix
#

I really dont like bringing the scheduler into those things because i usually just have a few runnables at a time that always run and
the only other way im using the scheduler is by delaying something by a tick. It just feels unclean.

tender shard
#

yeah, delaying by one tick is basically just an emergency solution

#

if nothing else works 😄

lost matrix
#

But sometimes there is no workaround. Take the BlockBreakEvent. You cant set the block in the same tick after the player broke it.
You need to delay that placement by a tick.

olive lance
lost matrix
#

You can as well get the biece to equip and the pieces currently on the player which are on a different slot
and determine the set right there. But then you miss out on other plugins which might cancel the event after your listener.

shell finch
#

is there any way to get the block touching a certain block's face?

shell finch
#

I'm assuming getRelative(BlockFace face) would do what I'd need then?

tender shard
#

yes

shell finch
#

thanks a lot :D

tender shard
#

np 😄

tardy delta
#

i fixed my bug and i have two bugs now 🥺

shell finch
#

I'm quite new to the spigot api so ill probably be asking questions here often

tender shard
#

thats what this channel is for 🙂

oblique geyser
#

I'm having trouble trying to import FastAsyncWorldEdit-Core 2.4.4 the IDE doesn't give any problem but when try to compile: is giving cannot find symbol in

ClipboardFormats.findByFile(file)
                cannot find symbol->.load(file)
kind hatch
#

Is it possible to merge/combine multiple FileConfigurations into a single one?

tardy delta
#

copilot 🤡

tender shard
#
for(String key : conf1.getKeys(true)) {
  conf2.set(key, conf1.get(key));
#

sth like this

reef lagoon
tender shard
#

for me it's almost always working perfectly fine

shell finch
#

How can i set a block to be facing a certain direction?

tender shard
#

depends on the block type

#

most block's BlockData implement Directional

tardy delta
#

Directional#setDirection o smth?

shell finch
#

yeah ive been trying to do taht but it hasnt been working

tender shard
#

Directional directional = (Directional) myBlock.getBlockData();

#

then you can set the direction

shell finch
#

hmm i foudn taht on stack overflow too

#

wait i think i know my problem

tardy delta
#

love the method names uwu

shell finch
#

Hmm seems to not be working still

oblique geyser
quaint mantle
#

but still the same error

remote swallow
#

Show your code

quaint mantle
#

its on my git

remote swallow
#

link it

shell finch
#

I've found my error i didnt know i had to do block.setBlockData()

quaint mantle
odd wedge
#

Send your command class and main class.

quaint mantle
#

updating

#

wait wait

oblique geyser
eternal night
#

wat

shell finch
#

when setting a block a torch how can i get it to be a normal torch and not a wall torch?

eternal oxide
#

set the material to TORCH not WALL_TORCH

slate mortar
shell finch
#

yeah i saw but setting a block as Material.TORCH still gives a wall torch

eternal oxide
#

set it without physics

#

if its near a wall your physics update turns it into a wall torch

slate mortar
#

why would it automatically do that anyway

quaint mantle
shell finch
#

ill try but its not near any walls

slate mortar
eternal oxide
#

then its impossible for it to turn into a wall torch if you are not telling it to

shell finch
slate mortar
#

weird

eternal oxide
#

Do it without physics so it gets no update

slate mortar
#

that shouldn't happen in normal cases

shell finch
#

how can i set a block without physics

eternal oxide
#

seType(Material, false)

shell finch
#

thanks

#

still same problem

#

it defaults to facing south

eternal oxide
#

show some code then

#

?paste

undone axleBOT
shell finch
eternal oxide
#

why are you setting the blockData?

shell finch
#

doesn't work if I don't

eternal oxide
#

of course it does

#

you are simply setting the type

shell finch
#

I just removed it and now it's broken again

eternal oxide
#

Your BlockData will be wrong anyway. you got it from teh hitBlock not the torch

shell finch
#

with it i can get it to stick to walls

eternal oxide
#

all you have to do is setType on the block. nothign else to make it a torch

shell finch
#

I've tried that and it deafults to a wall torch facing south

gray merlin
#

for some reason, in spigot 1.11, the colour modifier tags for dyes are wrong... 8 becomes light gray dye, instead of gray, and 14 becomes red instead of orange... is there a fix for this? I need it to be normal.

eternal oxide
kind hatch
sterile token
#

People who code in olde r versión mostly are doing it for work.

gray merlin
gray merlin
eternal night
#

my condolences

sterile token
#

In my case most comisions are from old versión. And they pay much than 1.19 because there are sousans of 1.19 devs rather old versión

gray merlin
#

Kind of like how FORTRAN devs are paid basically in gold these days

iron glade
#

what's that

eternal night
#

comparing 1.11 spigot api devs to fortran developers is golden

#

😂

kind hatch
#

Why not? You just need to return the proper value. So if you do smthing like

public enum Colors {
  RED(14),
  LIGHT_GRAY(5),
  ;

  private final int value;
  Colors(int value) {
    this.value = value;
  }

  public int getValue() {
    return value;
  }
}
#

@gray merlin

sterile token
#

Imagine I have been offered +255 dollars for just a 1.8 simple mini game. And i rejected cuz of time

gray merlin
gray merlin
kind hatch
#

I wonder if the older versions of the game use the hexadecimal value for the colors. 14 = red sounds similar enough to it.

sterile token
#

I can say that you will get more money in 1 week coding 1.8 projects rather than 1 month of 1.19 projects

#

That you cant argue

#

Hahaha

gray merlin
eternal oxide
# shell finch I've tried that and it deafults to a wall torch facing south

I just tested and it works perfectly. a TORCH not a wall torch.```java
public class TorchArrow implements Listener {

@EventHandler
public void onHit(ProjectileHitEvent event){
    
    Block block = event.getHitBlock();
    
    if (block == null) return;
    
    block.getRelative(event.getHitBlockFace()).setType(Material.TORCH, false);
}

}```

shell finch
#

hm

gray merlin
#

I'll go for a walk and think of a solution. Thank you for the help ^^

shell finch
tender shard
kind hatch
# gray merlin 1.7.10-1.10 certainly do, i've ported my plugin there. 1.11 **specifically** has...

Hmm, I'm not sure if you'll find an easy solution to this if you want version independent code. If the game messed up its implementation of it on only that version, you could chalk it up to a bug and leave it be.

However, if it's only this version that's messing up, you could do a hacky workaround by checking the server version each time you want to send the colors.

if version is 1.11
  use alternative values
else
  use the normal values

Does it look nice? No.
Will it get the job done? Yes.

terse ore
#

how can I get normal: special:...

#

in config.yml

#

like is there a way to get all the items inside menu

tender shard
terse ore
#

what does getKeys mean?

#

like color: ?

tender shard
#

it gets the keys?

shell finch
tender shard
tender shard
#
api-version: "1.13"
shell finch
#

i'll add that then

#

wasn't aware i had to do that

tender shard
#

if you don't add this, then the server will enable "legacy material support" and will basically think that the materials you use (e.g. "TORCH") are the "legacy names", like pre 1.13

#

so you should always set the api-version to the lowest MC version you wanna support

shell finch
#

thanks for the tip!

#

im trying it out rn

#

thanks now Material.TORCH is giving a normal torch

#

ill change up my code a little to make it attach to walls too, thanks

viscid ember
#

trying to change the damage for a sword from
Default : 6
to
Modified : 3

however it just gives me this

#
        meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier("GENERIC_ATTACK_DAMAGE",3,
                AttributeModifier.Operation.ADD_NUMBER
        ));
tender shard
#

set it to -3

#

3 means "6 + 3"

kindred valley
#

Alex

#

What way do you prefer about managing threads

tender shard
#

using the scheduler

#

outside of spigot I just use ThreadPoolExecutors

kindred valley
#

No i mean in java

viscid ember
hasty prawn
#

Isn't that what you wanted

tender shard
#

that's exactly what they asked for

#

6-3=3

hasty prawn
#

Maybe they want to remove the armor slots? If you only want it to be main hand then Add EquipmentSlot as well

viscid ember
#

^^^

#

i want to remove the armor slots

#

basically like this

hasty prawn
#

EquipmentSlot.HAND after your Operation argument

#

Alex is still right about -3 though btw

viscid ember
#

aight bet

viscid ember
hasty prawn
#

Nope, just EquipmentSlot.HAND

viscid ember
#

oh nvm had a look at the api

#

AttributeModifier(UUID uuid, String name, double amount, AttributeModifier.Operation operation, EquipmentSlot slot)

#

'AttributeModifier(java.util.UUID, java.lang.String, double, org.bukkit.attribute.AttributeModifier.Operation)' in 'org.bukkit.attribute.AttributeModifier' cannot be applied to '(java.lang.String, int, org.bukkit.attribute.AttributeModifier.Operation, org.bukkit.inventory.EquipmentSlot)'

        //other stuffs
        meta.addEnchant(Enchantment.LUCK, 1, false);
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier("GENERIC_ATTACK_DAMAGE",-3, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.HAND));
        item.setItemMeta(meta);
        sword = item;
``` i am a little bit lost
hasty prawn
#

What version are you using

#

Oh, wait, it wants a UUID

#

Before the "GENERIC_ATTACK_DAMAGE"

#

Which can just be UUID.randomUUID()

viscid ember
#

also when o set it to -3 it does no dmage

slate mortar
#

damages yourself KEKW

gray merlin
#

Right...

#

I did virtually nothing

#

like i didn't even change the values

#

and suddenly it's all as it should

slate mortar
#

welcome to development my lad

gray merlin
#

I thought that was a joke, it had never happened to me

slate mortar
#

nah that can be a thing

gray merlin
#

I've been programming for years, I always thought it was a gag

#

oh my god.

viscid ember
#

if it works dont question it

#

tf2 coconut

slate mortar
#

i made a game once
and it's stupid to see which kind of things can destroy other kinds of things

#

like

gray merlin
# viscid ember tf2 coconut

IIRC that was used for a particle, and broke TF2 during particle loading, cause it was associated to pyro's weapon

#

but yes

slate mortar
#

placing a png-texture onto something essentially made the character able to clip through walls

#

and people still think that all bugs are easy to fix

patent fox
#

how can i reset a players skin after changing his skin?

slate mortar
#

afaik mojang servers have those skins saved

#

so

#
Player player;
player.getPlayerProfile().getTextures().setSkin("url");

i suppose this should do it, never tried tho

tender shard
#

tea is nice

opal juniper
#

is there a way to "listen" for methods being annotated a specific way?

tender shard
#

wrong quote

#

you can get all method annotations using Method#getAnnotations()

opal juniper
#

lol, well i am trying to make a listener thing (not bukkit). And in order to avoid the whole like registerEvents(listener) is there a way to know what methods are annotated and listen for new instances being created to track them too

tender shard
#

Method method = Bukkit.class.getDeclaredMethod("getServer" );
Annotation[] annotations = method.getAnnotations();

#

just loop over all methods in your class, then check for the annotation

opal juniper
#

its not my class tho, others can use the api

tender shard
#

but wouldnt people extend one of your classes?

#

e.g.

public abstract class MyListener {
  public MyListener() {
    for(Method method : this.getClass().getDeclaredMethods()) // register your stuff here
#

and then people can just extend MyListener

mild sonnet
#

Hey, is there a way to remove an entities AI without removing that the entity can attack a player (Target)

viscid ember
#

Hey alex so instead of doing -3 which does negative damage i just change the value to 2

#

and now it does 3 damage

vocal cloud
#

Give it a random UUID in the pdc

#

?pdc

tender shard
#
    public static void makeUnstackable(ItemStack item) {
        ItemMeta meta = item.getItemMeta();
        meta.getPersistentDataContainer().set(new NamespacedKey(myPlugin, "unstackable"), PersistentDataType.STRING, UUID.randomUUID().toString());
        item.setItemMeta(meta);
#

your plugin's main class / instance

#

fuck you mojang

wraith bane
#

The reference to the class that extends JavaPlugin

wraith bane
#

U can't put the class itself, u need an instance of it

quartz solstice
#

Hi, I am getting an issue with the plugin instance with the NamespacedKey function. I have a non-static method called getInstance() on the main plugin class, and I want to use it from another file. The problem is I don't know how to get the main plugin class in the first place to use the getInstance method. Can anyone help or direct me to a link?

tender shard
#

erm

#

you have non-static getInstance() method?

#

isn't that totally useless?

viscid ember
#

Is there a way for me to add emojis or icons to custom names

viscid ember
#

i want to use this emoji in a custom name for example 🌟

toxic reef
#

custom name?

tender shard
#

custom name of what?

viscid ember
#

entity

#

just basically nametag

toxic reef
#

probably yes

#

try it

tender shard
#

should work fine I guess

viscid ember
#

ok nvm its only specific symbols you can use

tender shard
#

yeah the symbol you sent look like this for me

reef lagoon
#

my name's jeff

mild sonnet
#

Hey, is there a way to remove an entities AI without removing that the entity can attack a player (Target)

tender shard
#

you can remove all pathfinder goals except the attack one

#

but that requires NMS or a lib

viscid ember
#

yh

#

||☠ ☮ ☯ ♠ Ω ♤ ♣ ♧ ♥ ♡ ♦ ♢ ♔ ♕ ♚ ♛ ⚜️ ★ ☆ ✮ ✯ ☄ ☾ ☽ ☼ ☀ ☁ ☂ ☃ ☻ ☺ ☹ ۞ ۩εїз Ƹ̵̡Ӝ̵̨̄Ʒ ξЖЗ εжз ☎ ☏ ¢ ☚ ☛ ☜ ☝ ☞ ☟ ✍ ✌ ☢ ☣ ♨ ๑ ❀ ✿ ψ ♆ ☪ ♪ ♩ ♫ ♬ ✄ ✂ ✆ ✉ ✦ ✧♱ ♰ ∞ ♂ ♀ ☿ ❤ ❥ ❦ ❧ ™ ® © ✖ ✗ ✘ ♒\n" +
"■ □ ▢ ▲ △ ▼ ▽ ◆ ◇ ○ ◎ ● ◯ Δ ◕ ◔ʊ ϟ ღ ツ 回 ₪ ™ © ® ¿ ¡ ½ ⅓ ⅔ ¼ ¾ ⅛ ⅜ ⅝ ⅞ ℅ № ⇨ ❝ ❞ # & ℃∃ ∧ ∠ ∨ ∩ ⊂ ⊃ ∪ ⊥ ∀ Ξ Γ ɐ ə ɘ ε β ɟ ɥ ɯ ɔ и ๏ ɹ ʁ я ʌ ʍ λ ч ∞ Σ Π➀ ➁ ➂ ➃ ➄ ➅ ➆ ➇ ➈ ➉Ⓐ Ⓑ Ⓒ Ⓓ Ⓔ Ⓕ Ⓖ Ⓗ Ⓘ Ⓙ Ⓚ Ⓛ Ⓜ Ⓝ Ⓞ Ⓟ Ⓠ Ⓡ Ⓢ Ⓣ Ⓤ Ⓥ Ⓦ Ⓧ Ⓨ Ⓩⓐ ⓑ ⓒ ⓓ ⓔ ⓕ ⓖ ⓗ ⓘ ⓙ ⓚ ⓛ ⓜ ⓝ ⓞ ⓟ ⓠ ⓡ ⓢ ⓣ ⓤ ⓥ ⓦ ⓧ ⓨ ⓩ{。^◕‿◕^(◕^^◕)✖✗✘♒♬✄ ✆✦✧♱♰♂♀☿❤❥❦❧ ™®©♡♦♢♔♕♚♛★ ☆✮ ✯☄☾☽ ☼☀☁☂☃☻ ☺☹ ☮۞۩ εїз☎☏¢ ☚☛☜☝☞☟✍ ✌☢☣☠☮☯ ♠♤♣♧♥ ♨๑❀✿ ψ☪☭♪ ♩♫℘ℑ ℜℵ♏ηα ʊϟღツ回 ₪™ ©®¿¡½⅓ ⅔¼¾⅛⅜⅝⅞℅ №⇨❝❞ ◠◡╭╮╯╰ ★☆⊙¤㊣ ★☆♀◆◇ ▆▇██■ ▓回□〓≡ ╝╚╔╗╬ ═╓╩ ┠┨┯┷┏ ┓┗┛┳⊥ ﹃﹄┌ ┐└┘∟「 」↑↓→ ←||

#

this + a lil more

#

is all the symbols that actually "render"

sacred mountain
#

will a current opened inventory close if i open a new one

sacred mountain
#

what

viscid ember
#

what

sacred mountain
#

anyways

viscid ember
#

i want to delay a task

#

so i want to set the custom names visible then make them so they are invisible i dont understand how bukkit runnable works

#

you could just do this through the console

quartz solstice
#

Anyone what to put for permissions in plugin.yml commands

viscid ember
#

i think it can only be one size

#

so you set the middle a

eternal oxide
#

each player can have their own WorldBorder

#

but each is always equal on all sides

fervent gate
#

How would I make a mob, let's say a zombie, always target the player?

#

Right now when a skeleton shoots it, the zombie will change targets.

sacred mountain
#

entitytargetevent

#

if target isnt the player cancel event

fervent gate
#

ah, thanks!

viscid ember
#
public class AttackEvent implements Listener{

    private MagicMayhem plugin;

    @EventHandler
    public void onEntityDamaged(EntityDamageEvent event){



        double damage = event.getDamage();
        Entity EventEntity = event.getEntity();

        Bukkit.broadcastMessage(String.valueOf(damage));
        Bukkit.broadcastMessage(String.valueOf(EventEntity));

        EventEntity.setCustomName("❁" + damage);



    }
}```

Entity gets damaged the damage is displayed on their head
#

now i want to setCustomName(null);
after 2 seconds of waiting

#

ik i have to use bukkit scheduler but iim so confused on how to use it

echo basalt
#

Magic & Mayhem? 👀

#

cubecraft fan?

kind hatch
#

?scheduling

undone axleBOT
viscid ember
#

and its going to be a Sword art online, Cube craft, Albion online inspired server

#

got a whole ass word document for it 🤣

viscid ember
vivid cave
#

Okay guys, hold your pu$$ies tight and enable your packet brains
_ _
Context: I'm doing gif animation through map, works flawlessly, server wise and client wise, thanks to packets (ClientboundMapItemDataPacket), threads, intelligent detection of what player actually see to only animate what they see, with bunch of configurable functions that adapt parameters such as framerate, view angle, view distance dynamically according to their TPS
Server side memory allocation is also optimised to clear the ram after an extended inactivity.
For bedrock players though it's not perfect despite all my efforts (but it's perfect for java players)
_ _
=> I still want to improve the horny bitch, cuz why not, so i thought of the following:

Instead of sending a new ClientboundMapItemDataPacket every 200ms (for example), send a clientbound packet that would edit the map id inside the itemframe (i already have all the active itemframes entities in a cache dw)
So that would mean that I send only once ClientboundMapItemDataPacket of EVERY frame to the player, each frame having a dedicated map id, and then all I need to do is foul their client to think that the itemframe entity change to another map id (of the next frame)
_ _
Motivation & question My thoughts behind this change is to reduce the bandwith usage of both client and server, because (if I'm not wrong but please that's precisly where i need your support into) I think that sending a packet that changes the content of an itemframe is much more lightweight than sending a whole map data (cuz a map is an array of 128x128 bytes), and as those packets have to be sent constantly, i could expect a big boost for bandwith usage? (even if rn i don't use that much, as i said, the whole stuff works very very good already); TL;DR Do you think the optimisation can be worth it or on the whole countrary it would be worse?

#

If you're concerned that dedicating a map id to every frame is a bit overkill, well 1) let me remind you that the maximal map id is soooooo big so there is a big margin 2) i plan to use a pool of map ids that I reuse only for the active rendering mapimages

#

So feel free to give your general thoughts about that, if you don't know for sure i still enjoy your input

tender shard
#

I love these types of error

toxic reef
#

just fix it bro

tender shard
echo basalt
#

regardless of the approach, you'll still end up sending 128*128 bytes per packet

#

no way to avoid that

#

I'd recommend you optimize frame rendering times rather than optimizing packet times

#

and make a buffer that only sends up to like 5 frames per tick, per player, to avoid flickering

vivid cave
echo basalt
#

On top of that, only send packets for maps whose contents have changed

tender shard
#

I thought it was about handheld maps

echo basalt
#

And don't use bukkit's mapview stuff

#

make your own image -> byte[] converter like I did

vivid cave
#

@echo basalt all the optimisations you're mentioning have already been done but thanks

echo basalt
#

How long does it actually take to render an image?

#

From actually getting the image and updating colors, until the packet is actually sent

#

assuming there are no time limiters

#

If it's over 0.5ms, then you have a problem

vivid cave
#

idk man its very quick but i add some delay manually so that cpu cores can breathe

echo basalt
#

I mean it's not really that CPU intensive

#

Focus on optimizing most things but bandwidth

#

you still need to send a map packet regardless

vivid cave
#

ik but considering that 2000+ frames may be rendering i prefer to ensure that cpu is breathing from time to time

river oracle
#

I always focus on optimizing bandwidth lol otherwise I can't connect to my server

echo basalt
#

there are some bandwidth parts you can't really optimize

#

sure you can do that id-thing if you send the data over time, and render the gif all at once

#

like pre-caching frames for the client ig

river oracle
#

it doesn't get tired like a human

vivid cave
#

thats what i'm planning, send them only once every frame 128x128

echo basalt
#

I tend to just optimize everything server-side and let the client do its own rendering

#

doesn't flicker and it's very fast

#

raytracing takes about 10mu (10000ns / 0.01ms), async ofc
rendering an image takes about 8mu (8000ns / 0.008ms), async

vivid cave
echo basalt
#

These are the kind of performance metrics that you need to have, before considering buffering images on the client

#

And only buffer images on the client if you actually need to

sterile token
#

I need recommendations for designing a simple but effcient java Messenger

echo basalt
#

you can render images async, and cache them along with the packets

sage dragon
#

Hey,

I want to make a prefix plugin which supports hex colors.

Problem is that a scoreboard Team does not take hex colors, so I wantes to do it with invisible armorstands.

There's just one problem with this: Sneaking does not hide the nametag through blocks anymore...

Is there a better way to do this?

echo basalt
#

breathing room in that context would be wasteful

midnight glade
#

I mean you can do a tcp messenger in like 40 lines tops

sterile token
vivid cave
quiet ice
echo basalt
#

if your async shenanigans are hitting your mspt you're doing something wrong

#

also if your code is that optimized, and you still need breathing room then it's ehhhh

quiet ice
#

Also protip: -noverify

echo basalt
#

Just run it through 7smile7's workload distribution and you should be good

#

?distro

#

what's the comamnd

#

gr

kind hatch
#

?workdistro

echo basalt
#

that

river oracle
#

what is all the hype with optionals in java? I don't get it its just a slower wrapper to a normal null check?

echo basalt
#

nullability wrapper yeah

#

I'd say it's useless

river oracle
echo basalt
#

we should write plugins in assembly

quiet ice
#

It can be used as an immutable wrapper that includes null while being non-null itself

echo basalt
#

useful for maps ig

river oracle
quiet ice
river oracle
#

i see its uses for streams, but I keep seeing people saying crap like return with OPtional if output can be nul!

#

thats just dumb

quiet ice
#

I myself rarely use it, but if I cannot use any nullabillity annotation library for some reason, I'd use Optionals myself

vivid cave
# echo basalt if your async shenanigans are hitting your mspt you're doing something wrong

you are wrong, because the async threads do use the main memory too, many things have locks in the main thread
Also it's important to understand how a thread works
A thread shares the same cpu core with many other threads. Java thread pools makes it well so it uses threads of different cpu cores, but my server ain't a beast and doesn't have much cpu cores, so most often the threads share the same cpu core. CPU itself is like food, if a shenanigan (thread) eats all the food then the other threads using the same CPU start to suffer as well. And as every threads have at some point some locks with the main thread, it increases teh chance that some hold a lock in the main thread for too long and hence causing the main thread lag

river oracle
#

if you aren't using something like lombok idk what you doing

quiet ice