#help-development

1 messages ยท Page 1134 of 1

remote swallow
#

what am i a shit snapshot of

worldly ingot
#

Life

remote swallow
#

trueeeeeeeeeeeeeeeeeeeeeeeeeeee

torn shuttle
#

people do say I make any room I enter better

#

any server I join goes up to 40 tps

river oracle
acoustic pendant
#

Hey, Could someone help me? I have a code which is crashing my server (Don't know why because error doesn't register in logs and I cannot see the error in the console)
I think the code is pretty normal, but could someone tell why it may be crashing?

    @EventHandler
    public void onDamageWithZeusArmor(EntityDamageByEntityEvent e) {
        if (!(e.getEntity() instanceof Damageable entity))
            return;
        if (!(e.getDamager() instanceof Player player))
            return;

        ItemStack helmet = player.getInventory().getHelmet();
        ItemStack chestplate = player.getInventory().getChestplate();
        ItemStack leggings = player.getInventory().getLeggings();
        ItemStack boots = player.getInventory().getBoots();

        if (plugin.armorUtils.isWearingZeusArmor(helmet, chestplate, leggings, boots)) {
            Entity nearestEntity = getNearestEntity(entity);
            if (nearestEntity == null)
                return;
            if (!(nearestEntity instanceof Damageable nearestDamageable))
                return;
            double damage = e.getDamage() * 0.2;
            nearestDamageable.damage(damage, player);
            nearestEntity.getLocation().getWorld().spawnParticle(Particle.REDSTONE, nearestEntity.getLocation(), 1, 0.1, 0.1, 0.1);
        }
    }```
river oracle
#

Literal genius

torn shuttle
#

I should make a plugin that displays the server's tps and adds +20 if I am logged into that server

hybrid spoke
#

nearestDamageable.damage(damage, player); calls the event again which calls the method again and so on

torn shuttle
#

you're making a damage event damage entities

hybrid spoke
#

you're in an endless loop

acoustic pendant
#

That makes sense ๐Ÿ’€

acoustic pendant
#

Or should i be using setHealth instead?

hybrid spoke
#

you can also trick a bit around and have a list storing the entities damaged, then check in the event if the list contains the entity and cancel + remove if so

#

by that you break the endless chain

acoustic pendant
#

Yeah, could make that too

acoustic pendant
glossy laurel
#

Guys how do I start learning bedrock

#

java is too hard

echo basalt
#

gl with that

river oracle
hybrid spoke
#

cant break it

humble tulip
glossy laurel
#

I'll just make the location point to null

#

boom

#

ez

#

bedrock broken

#

trust the process

humble tulip
#

Works because mc is single threaded so u dont need a collection since only 1 entity can be damaged at a time

hybrid spoke
#

so you take the location of the bedrock away sending it to the void, making it a literal god between space and time

#

you just destroyed minecraft sir

torn shuttle
#

guys java is too hard how do I solo dev an mmorpg that is a 1:1 scale of our solar system and can run 10bil concurrent players? I really want to future proof it for future demographics

eternal oxide
#

ask ChatGPT of course

torn shuttle
#

good point

river oracle
#

You're the greatest developer ever sauce

hybrid spoke
#

๐Ÿฅ„

torn shuttle
#

I think I know how to solve this lame answer

woven glade
#

can someone lead me a to gradle runtask to try the plugin in a local srv ?

torn shuttle
#

lame I have to like follow steps n shit

hybrid spoke
eternal oxide
#

ask to do it in Jython

torn shuttle
#

it can't edit unity so really it just just make its own engine

#

in python since chatgpt can run python

eternal oxide
#

Jython not python

torn shuttle
#

I would use jython but I'm afraid the performance would just be too good

eternal oxide
#

time travel

echo basalt
#

make it in a modified version of the source engine

#

just like most modern games

torn shuttle
#

I don't want the game to run higher than 25fps because the human eye can only see 24.7 fps

robust jolt
#

Hi, there is a way for prevent someone from closing inventory?

#

Because InventoryCloseEvent doesn't contains e.setCancelled(true)

torn shuttle
#

pretty sure there isn't

#

could always reopen it

echo basalt
#

how the fuck am I colliding with a client-sided entity

#

bedrock moment

pseudo hazel
torn shuttle
pseudo hazel
#

blame my graphics card

#

not my cpu

torn shuttle
#
  • notch, 2011
echo basalt
#

there's a mega simple solution but it needs resourcepack work

torn shuttle
#

classic

echo basalt
#

or some heavy networking shit and a somewhat big rewrite

torn shuttle
#

also classic

#

also boys good news

drowsy helm
#

Teach me

torn shuttle
#

I'm finally going to implement procedurally generated builds

#

except it's the fancy kind

#

the real fancy kind

#

I'm going to try to do some wave function collapse

drowsy helm
#

Teach me beard man!!

torn shuttle
#

watch the yt video I'll make about it loser

drowsy helm
#

I hope your wave function collapses

torn shuttle
#

or if you're talking about long screenshots you have addons or in my case a 4k monitor in portrait mdoe

#

but there's chrome and ff addons for this anyway

#

but yeah I'm hyped for wave function collapses

#

finally something fun

#

I kinda want to buy an 8k monitor

#

hmmm

drowsy helm
torn shuttle
#

work

drowsy helm
#

The characters in your ide not clear enough or smth lol

torn shuttle
#

definitely not games nothing is made for or would run properly at 8k

#

no, I'd want an 8k monitor that is also over 60 inches, maybe 70

#

that way I can comfortably have 3-4 IDEs open

drowsy helm
#

Isnt that just a tv atp

torn shuttle
#

yeah and I already have one in my setup

glossy laurel
#

Can I detect when a player right click another player?

#

interact event?

drowsy helm
#

Pretty sure entity interact gets called

torn shuttle
drowsy helm
#

Rip your neck

torn shuttle
#

buddy I own an office chair

#

they lean back

eternal oxide
#

lol on the keyboard

glossy laurel
#

rip your everything

glossy laurel
peak depot
torn shuttle
#

we don't fuck around

drowsy helm
#

Entity interact is when a non player entity interacts with world

echo basalt
#

interact at entity still fires once in a while

glossy laurel
#

"that also contains the location where the entity was clicked"??!!

drowsy helm
#

Player interact is with world objects, player interact entity is with entities

glossy laurel
#

like where you click the entity on their body or something??

drowsy helm
#

Itโ€™s just player interaction entity with extra stuff

glossy laurel
echo basalt
#

oh fuck off

drowsy helm
#

Yes but not in this case

#

My definition is loose

torn shuttle
#

hm I think the air quality is good enough again

#

time to hit the gym

slender elbow
#

PlayerInteractAtEntity is basically only ever called when you interact with an armor stand

floral drum
#

they know how many developers use packets

slender elbow
#

i mean

#

all the byte buffer ctors are private

#

since they are only ever created from the network, not really the game

#

you should use the codec :3

young knoll
slender elbow
#

actually, i don't understand this

#

the event should be called every time alongside the regular PlayerInteractEntity except for amor stands? :thonk:

glossy laurel
#

Does anyone happen to know if worldguard bases its whole system on playermoveevents or does it only use to avoid players entering regions theyre not supposed to

echo basalt
#

apparently java 22 on ZULU breaks everything at work

#

like resourcepacks don't apply

#

if we switch to temurin or back to java21 it works

#

the fuck

glossy laurel
#

java 22 broke my graalvm dependency one day

paper viper
#

Why does it break shit

#

What did they do

blazing ocean
#

everywhere

paper viper
#

What happened

echo basalt
blazing ocean
#

not for moi

slender elbow
#

that includes entry and exit flags, and whatever other handlers plugins have registered through the api

#

although worldguard only uses the event if you are crossing block boundaries, so movements within a same block are ignored

glossy laurel
#

sounds pretty useless

slender elbow
#

and yes there is a setting in the worldguard config for that

#

use-player-move-event or whatever

#

but it really doesn't impact that much at all given it only checks things when crossing block boundaries

harsh ruin
#

how to make boat
immobilized (including its rotation) ?

glossy laurel
#

?mysql

#

no?

#

how do I use mysql then

#

any tutorial mby?

#

im using YamlConfiguration atm btw

#

so I'd need some good way to transition

#

i

#

g

hard socket
#

some googling

glossy laurel
#

What's the difference between running async through scheduler and completable futures?

young knoll
#

well one gives you a future the other doesnโ€™t

#

And by default futures use the common thread pool while async task use the cb thread pool

glossy laurel
#

so basically

#

no difference

glossy laurel
#

and if I just do .runAsync

#

and dont save it in a var

#

then it doesnt give me a future

humble tulip
#

Even if yoh save it

#

It's still not a future

glossy laurel
#

between it giving me a future

#

and not

glossy laurel
#

this is CompletableFuture.runAsync

#

btw

humble tulip
#

Ohhhh

#

Ok yes

#

You're right

#

With a future you can cancel it, and use values it returns or run code when your future finishes execution

glossy laurel
#

right

#

and if I dont

humble tulip
#

So you can CompletableFuture.runAsync(getUserFromDb).thenAccept(Bukkit.getScheduler.runSync(do something with player daya sync))

glossy laurel
#

no difference?

humble tulip
#

No difference i suppose

glossy laurel
#

which I really don't wanna do

#

cuz it looks painful

humble tulip
#

It's easy

#

But can be a little tricky

#

If you need help, @me

glossy laurel
#

just dunno where to start

humble tulip
#

First start by learning some myswl

#

W3 schools is great for that

#

Just to learn syntax and how it works

glossy laurel
#

hmm

humble tulip
#

Then you can try connecting to a db from Java

#

With sqlite/mysql

chrome beacon
#

You modify the transformation

glossy laurel
#

I didn't need to learn another programming language rn

#

๐Ÿ˜ญ

chrome beacon
glossy laurel
humble tulip
#

It's simple

#

Learn how to create a table

#

Then learn how to select, insert update and delete from a table

#

The 4 main operations

#

After that u can start using databases

#

There's a lot more to it but that's the basics

chrome beacon
#

crud uwu

glossy laurel
#

what is this, excel?

proper cobalt
chrome beacon
#

setTransformation

#

Use the javadoc

#

?jd-s

undone axleBOT
proper cobalt
#

kk thank u

slender elbow
humble tulip
#

But better for certain usecases

glossy laurel
humble tulip
#

Also important to learn are primary and unique keys

glossy laurel
chrome beacon
#

It's really not that bad

slender elbow
#

normal forms :nodders:

humble tulip
#

@glossy laurel is ur current plugin public?

#

It's okay to register a bunch of listners dynamically right?

river oracle
glossy laurel
#

open source public?

humble tulip
#

Yes

glossy laurel
#

no

river oracle
#

If you're taming user chat input etc its not a great idea to clean them up as they'll likely be used often

#

Reflection is fast comparatively to what it used to be but having it done all the time probably isn't great

humble tulip
#

I mean I'll be putting registeredlisteners directly into the handlerlist

#

So no reflection there

#

It's just sm more work to write a system to have only one listener per priority as needed and then pass the event to my consumers

humble tulip
slender elbow
humble tulip
#

Ugh now I'm on like 2 layers of side quest for my project

humble tulip
#

Just for knowledge purposes

#

You mean methodhandles?

slender elbow
#

hotspot will inline method calls if the Method/MethodHandle is a constant (static final or resolved from the constant pool), it makes it "trusted" as it cannot be changed to another Method instance, therefore it can inline the call, but the way spigot does it is just a regular field so hotspot can't do that

river oracle
proper cobalt
chrome beacon
#

Show how you use that

#

Actually wait why are you setting the offset to the location

proper cobalt
#

what offset

chrome beacon
#

The transformation offset

#

named translation in Spigot

proper cobalt
#

idk what do i pass in instead

chrome beacon
#

0

#

You don't want any

#

Use the website I linked

proper cobalt
#

ok ill try it now

#

aights it not doing anything now

#

its staying unrotated

#

but not dissapearing

fair rock
#

im was testing the website olivio send you, im just curious can you switch:

this line:
new AxisAngle4f(0, 1, 0, (float) Math.toRadians(degrees)),

to:
new AxisAngle4f(0, (float) Math.toRadians(degrees), 0, 1),

proper cobalt
#

Aye ill try it

fair rock
#

Ah kk, was just curious about that

proper cobalt
#

mannnnn how can i rotate dis ruh

fair rock
#

What do you try to rotate?

proper cobalt
#

itemdisplay

slender elbow
#

algebra ๐Ÿ‘ป

chrome beacon
#

Show us how you're using the transform

fair rock
eternal oxide
#

how do you want to rotate it?

#

what are you trying to do?

proper cobalt
#

rotate an itemdisplay

eternal oxide
#

yes, but what exactly

proper cobalt
#

its just facing the wrong way

#

and its dynamic so i need to rotate it on the fly

eternal oxide
#

you need to tell us EXACTLY what you are doing so we can answer. rotating is simple, but HOW/WHY you want to rotate is what we need to hear

fair rock
#

Idk if im stupid but a ItemDisplay is a entity so setRotation would work if you "just" want to rotate it, or not?

proper cobalt
fair rock
#

Try it?

eternal oxide
#

so just set it the directyion between them

#

both locations to Vector, subtract one from the other and normalize

echo basalt
#

mm getting entities async

#

what can go wrong

proper cobalt
fair rock
#

im stuck at "moonrise" idk my head plays several movies in my head like minions and steal the moon

proper cobalt
#

not directly in the players eyes

eternal oxide
#

you didn;t say that

echo basalt
#

will it pass code review

fair rock
#

I feel your comment, ew but it works

echo basalt
#

deadline's tomorrow I can't ask for much

#

ah found the error

#

much better

#

what can go wrong

fair rock
#

Ah your reference was like first: zombie.entityId but it needed entity.entityId?

proper cobalt
#

yeah @fair rock that worked idk why they told me to use a transformation

fair rock
echo basalt
#

because running stuff on a timer results in nasty desyncs

vernal halo
#

what can i put in plugin.yml so my plugin loads last?

echo basalt
#

console isn't exploding anymore I think this works

proper cobalt
vernal halo
proper cobalt
#

LoadBefore:

river oracle
chrome beacon
river oracle
#

add dependencies you need

fair rock
river oracle
fair rock
#

You can listen on that event and load everything there instead in onEnable

river oracle
#

instead of abusing events and attempting to load first

fair rock
#

just add listener in onEnable

river oracle
#

actually use the dependency system

vernal halo
#

kk, no worries. load-before works well

fair rock
#

I was like loading plugin after all plugins every time xD

toxic sage
#
                ItemStack itemStack = new ItemStack(Material.DIAMOND_SWORD);
                ItemUtils.setItemMeta(itemStack, meta -> {
                    meta.setDisplayName("name");
                    meta.addItemFlags(ItemFlag.values());
                });

                player.getInventory().addItem(itemStack);

How do I hide attributes on 1.21.1?

glossy laurel
#

how to make the name above player's head display differently to different players and custom? I suppose nms but where do I start

olive vault
#

anyone know how to make minecraft finding a safe spawn location in a world async?

glossy laurel
olive vault
#

you can get chunks async now so why not?

remote swallow
#

get a chunk snapshot and use it async

remote swallow
olive vault
#

oh

#

yeah

remote swallow
#

do i have to use the command

olive vault
#

please dont

#

i leave now

#

;P

#

(not actually) i like spigot

river oracle
olive vault
#

uhh

#

idk where it stores the chunk thingy

river oracle
#

You can do this concurrently and destroy all threads as soon as one is found

olive vault
#

stores the setSpawn thingy in paper

river oracle
#

You have to load the chunks syncrhonously in spigot

#

But the searching can be done concurrently

olive vault
#

any example plugin?

river oracle
olive vault
#

wait in chunKGenerator there is a canSpawn method, is this useful?

@Override
public boolean canSpawn(@NotNull World world, int x, int z) {

}
#

I want to see how minecraft does it

#

but I cant find it in papers source code

#

it would be in the chunkgenerator class of the overworld but idk where that is

glossy laurel
#

how to make the name above player's head display differently to different players and custom? I suppose nms but where do I start

#

0 nms experience btw

olive vault
#

try display entites

echo basalt
#

start by googling it

#

p much just update the profile n respawn the player

#

if you want diff players to have diff names you need to do some funky packet interception

glossy laurel
gaunt basalt
#

Hi could anyone help me fill this command in from the coin plugin?

#

/coin drop <x,y,z,world>

chrome beacon
gaunt basalt
#

I did

glossy laurel
slender elbow
#

๐Ÿค“ it's actually one coordinate with four dimensions

umbral ridge
#

No

#

It is

#

1 dimension in 4 coordinates

glossy laurel
#

"one of a pair of numbers and/or letters that show the exact position of a point on a map or graph"

#

One of

glossy laurel
ivory sleet
#

I mean emily isnโ€™t wrong, world name is just some linearly independent data on top of the three coordinates already

alpine urchin
#

what about time

ivory sleet
#

I mean you can probably find a homomorphism between the two

junior cradle
#

How to update the skin for NMS version 1.20.6
I can install the skin but it appears only after I reboot to the server and not dynamically?

private void reloadPlayer(@NotNull ServerPlayer serverPlayer) {
        serverPlayer.connection.send(new ClientboundPlayerInfoRemovePacket(List.of(serverPlayer.getUUID())));

        Bukkit.getScheduler().runTaskLater(Anarchy.get(), () -> {
            serverPlayer.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, serverPlayer));
            serverPlayer.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED, serverPlayer));
            
            serverPlayer.teleportTo(serverPlayer.getX(), serverPlayer.getY(), serverPlayer.getZ());
        }, 60L);

    }
quaint mantle
#

Hi everyone, can someone help me with this?
this makes an helix but just vertically, i wanna make it to spawn where player faces but i suck at maths so if anyone can explain to me how to do it (not givin me da answer but explaining) it would be fantastic :D

        for (double angle = 0; angle <= Math.PI * 10; angle += 0.35) {
            double x1 = radius * Math.cos(angle);
            double z1 = radius * Math.sin(angle);

            double x2 = radius * Math.cos(angle + 0.05);
            double z2 = radius * Math.sin(angle + 0.05);

            double y = (angle / (2 * Math.PI)) * ySeparation;

            Location tempLoc1 = loc.clone().add(x1, y, z1);
            Location tempLoc2 = loc.clone().add(x2, y, z2);

            final Location particleLocation1 = tempLoc1.clone();
            final Location particleLocation2 = tempLoc2.clone();

            new BukkitRunnable() {
                public void run() {
                    player.getWorld().spawnParticle(Particle.FLAME, particleLocation1, 0);
                    player.getWorld().spawnParticle(Particle.FLAME, particleLocation2, 0);
                }
            }.runTaskLater(Main.getInstancia(), delay);

            delay += 1;
        }
#

btw, double radius = .625; double ySeparation = .625;

smoky oak
#

you'll want an anchor point and an axis through it to rotate your locations around

#

dont ask me for the specific math behind it, did it once and forgor in the decade since

#

though i think bukkit does have some helper classes for it

#

@quaint mantle

quaint mantle
#

oh okay

#

thx

smoky oak
#

actually i think you dont need an anchor point if you just want to rotate the entire structure

#

the rotation axis would serve as one

quaint mantle
#

โ˜ ๏ธ

quaint mantle
#

ok

quaint mantle
#

dont say ? ? ? ? ? ?

junior cradle
#

@quaint mantle I don't get itClick to apply

quaint mantle
#

bro what

#

why u ping me

#

what's the point

#

js wait

junior cradle
#

@quaint mantle I just spent half a day on this to solve this problem, tried many variants of packages and it does not work and even the slightest hint is not why
All I know is that on the client side, the skin doesn't update for some reason until I teleport to another world or log back into the server
And I'm already burning a little bit

quaint mantle
#

ok

#

and?

#

wait to someone to answer

#

i don't know

#

if i knew i would answer

#

english only

junior cradle
#

Well, I didn't write to you directly and ask you, I don't know why such aggressio ๐Ÿ˜’

quaint mantle
#

you are literally pinging me

pseudo hazel
#

twice

quaint mantle
#

yup

#

thanks

junior cradle
#

To answer you, so that you can understand that this is about you, where have I been pinging you since the beginning?

junior cradle
#

The screenshot is not sent to me

quaint mantle
#

tf bro

#

js stop pinging

junior cradle
quaint mantle
quaint mantle
pseudo hazel
#

now you pinged me

quaint mantle
#

dont ping

pseudo hazel
#

stop arguing

quaint mantle
#

now twice

#

lol

pseudo hazel
#

close the chat if you dont want to answer, you arent obligated

quaint mantle
#

well u got a point

fair rock
junior cradle
smoky anchor
#

I believe the solution is "respawn the player" but it may be outdated

eternal oxide
#

Packets or use hidePlayer showPlayer

junior cradle
junior cradle
smoky anchor
#

Please use English
And I do not know how

fair rock
junior cradle
fair rock
#

Yes and No, the client thinks he lost his item, you have to sync it back

junior cradle
#

The default method is not only kill ?
What do you mean, โ€œI don't know an example?

#

I tried it, but the revive button doesn't work, I had to log out of the server -_-

serverPlayer.connection.send(new ClientboundPlayerCombatKillPacket(serverPlayer.getId(), net.minecraft.network.chat.Component.empty()));
sly topaz
#

why not just check how SkinRestorer does it

junior cradle
fair rock
#

First of, thats a legit answer, dont act like that.
You can "copy" how he has done it with ProtocolLib to make it yourself without

fair rock
#
             sendPacket(playerCon, respawn);
#

Yep, its respawn packet

sly topaz
#

you actually have to send quite a bunch to do it properly it seems

fair rock
#

The refresh method is only nms based for checking version and using the right classes and not ProtocolLib

#

3 years old, you have to fix some packets but its working

junior cradle
#

I tried to respawn, but it respawns somehow crooked and a loading window appears like when you zap to the server says Loading...

 final CommonPlayerSpawnInfo commonPlayerSpawnInfo = new CommonPlayerSpawnInfo(
                    serverPlayer.level().dimensionTypeRegistration(),
                    serverPlayer.level().dimension(),
                    serverPlayer.level().getWorld().getSeed(),
                    serverPlayer.gameMode.getPreviousGameModeForPlayer(),
                    serverPlayer.gameMode.getPreviousGameModeForPlayer(),
                    serverPlayer.level().isDebug(),
                    true,
                    serverPlayer.getLastDeathLocation(),
                    serverPlayer.getPortalCooldown()
            );
            serverPlayer.connection.send(new ClientboundRespawnPacket(commonPlayerSpawnInfo, ClientboundRespawnPacket.KEEP_ENTITY_DATA));
fair rock
#

Which version are you currently? I testet in 1.21

#
        serverPlayer.connection.sendPacket(new ClientboundRespawnPacket(
                new CommonPlayerSpawnInfo(
                serverLevel.dimensionTypeRegistration(),
                        serverPlayer.getRespawnDimension(),
                        serverLevel.getSeed(),
                        serverPlayer.gameMode.getGameModeForPlayer(),
                        serverPlayer.gameMode.getPreviousGameModeForPlayer(),
                        false,
                        false,
                        serverPlayer.getLastDeathLocation(),
                        0)
        , ClientboundRespawnPacket.KEEP_ALL_DATA));

Thats working for me without problem in 1.21

sly topaz
fair rock
junior cradle
fair rock
sly topaz
#

and since they're using internals anyway, they could call ServerPlayer#onUpdateAbilities and ServerPlayer#resetSentInfo (resets health and xp) instead for a few of these, but it's the same either way

fair rock
sly topaz
#

it is most likely the kept data field

fair rock
junior cradle
#

I don't really understand why.
Bukkit.getScheduler().runTaskLater(Main.main, new Runnable() {public void run() {
player.getInventory().setHeldItemSlot(slot);
player.addPotionEffects(effects);
player.setExp(player.getExp());
player.setHealth(player.getHealth()-0.0001);
player.openInventory(player.getEnderChest());
player.closeInventory();
}}, 2);

echo basalt
#

yikes old school lambdas and the main class being called Main

fair rock
#

Idk i copy pasted it just to try if it works

I would say the dude didnt wanted to sync all the stuff by himself with packets

#

xd

#

() -> {} love it

pseudo hazel
#

Main.main

sly topaz
echo basalt
#

It's an unconventional style

#

and we like conventions here

fair rock
#
if() {
  if() {
    if() {
      if() {
        if() {
          if() {
            if() {
              if() {
              }
            }
          }
        }
      }
    }
  }
}
echo basalt
#

yeetr

sly topaz
#

the lack of a space before the parenthesis hurts me more

fair rock
#

you mean if () { instead of if() {? (im not good with english thats why i had to google what the hell parenthesis is)

pseudo hazel
#

if(){} instead of if () {}

#

the first one being claustrophobic

fair rock
#

Real question now:

if () return true;

or

if () {
return true;
}

pseudo hazel
#

bottom

sly topaz
#

I usually do:

if (condition)
  return true;
slender elbow
#

switch

pseudo hazel
#

thats gonna hurt if you wanna add something else in there anyways

sly topaz
pseudo hazel
#

but if you are sure its gonna stay at return ,its fine ig

fair rock
#

I thought emily said switch as joke for another reason ๐Ÿ’€

slender elbow
#

trollface

pseudo hazel
#

the best switch is a boolean switch

#

switch (val) { case false:

junior cradle
#

It's cool, in principle, you can do the rest to +- normally and quickly

 private void updateSkin(ServerPlayer serverPlayer) {
        serverPlayer.connection.send(new ClientboundPlayerInfoRemovePacket(List.of(serverPlayer.getUUID())));
        serverPlayer.connection.send(ClientboundPlayerInfoUpdatePacket.createSinglePlayerInitializing(serverPlayer, false));

        final Player player = serverPlayer.getBukkitEntity();
        Bukkit.getScheduler().runTaskLater(Anarchy.get(), () -> {
            player.teleport(Bukkit.getWorld("spawn").getSpawnLocation());
            player.teleport(Bukkit.getWorld("world").getSpawnLocation());
        }, 1L);
#

I tested it and it works fine

sly topaz
#

doesn't it send you to configuration phase tho

#

I thought that was what we were trying to avoid

#

besides that may generate chunks, no?

#

not ideal but ยฏ_(ใƒ„)_/ยฏ

fair rock
#

Now im hurting you all in purpose

public boolean isEven(int number) {
  return switch (number) {
    case 1 -> return false;
    case 2 -> return true;
    case 3 -> return false;
    case 4 -> return true;
    case 5 -> return false;
    ...
  }
}
sly topaz
#

at least you used a switch expression

slender elbow
#

that doesn't compile ๐Ÿค“

sly topaz
#

you don't have to return on the case tho

fair rock
#

I messed up writing a messed up method

junior cradle
# fair rock fair

Thanks to you, I solved the problem, I can say I found a new way to understand the essence
by the way, you can try it with a teleport type package

fair rock
#

ouch, i dont needed a return in case

glossy laurel
#

So basically

#

My plugin ran normally for a while and now started throwing NPEs, command runtime errors, and cant pass event checks. Any clue?

eternal oxide
#

replaced jar with server running

#

or used plugman

glossy laurel
#

But I dont think anyone did that the second

#

Nvm

#

Someone did ๐Ÿ’€

#

Thx

eternal oxide
#

break their fingers

wet breach
glossy laurel
#

Is replacing their server jar in a running server a thing every plugin dev has to go through

eternal oxide
#

it generally only happens a few times when you start learnign to dev

glossy laurel
#

But like

#

Everyone done that at least once

#

Right

eternal oxide
#

yep

glossy laurel
#

Can u schedule it to update on restart?

#

Upload another one with higher version?

eternal oxide
#

yes

#

create an update folder and put the new jar there

#

teh server wil auto update it at startup

young knoll
#

I believe the jar name needs to match

eternal oxide
#

pretty sure it also works by teh plugin name now

#

as well as jar name

#

rings a bell

glossy laurel
eternal night
#

But yea, jar names have to match

glossy laurel
sly topaz
#

me putting the commit ref number in the jar name

glossy laurel
#

No versions in brackets?

sly topaz
#

I thought only the plugin.yml name had to match though, the more you know

glossy laurel
#

What exactly happens when I put the plugin into an update folder?

sly topaz
#

it gets updated

#

duh

glossy laurel
eternal oxide
#

next server start it gets copied into the plugins folder

glossy laurel
#

Deleted?

#

Or still there

#

And

eternal oxide
#

a ?tas moment

glossy laurel
#

Does it have to necessarily be called "update"

glossy laurel
glossy laurel
sly topaz
#

?tas

undone axleBOT
eternal night
#

on a popular server fork, the plugin name in plugin.yml is enough

glossy laurel
young knoll
#

Lynx

eternal night
#

coll

young knoll
#

Start runnin boi

eternal night
#

Fuck fuck fuck

glossy laurel
young knoll
#

I swear we had a pr for making it go by name

#

May be dead tho

sly topaz
#

it shouldn't even be that hard

eternal night
#

We had a patch for the old spigot plugin loader

#

but given we ripped out all of spigot plugin loading these days

#

ยฏ_(ใƒ„)_/ยฏ

sly topaz
#

but I assume the update process is done way earlier, before the plugin.yml in plugins get parsed

eternal night
#

Yea, far earlier

#

Which, tbf, is fine, you can still do it. Just need to do some doubled work

sly topaz
#

there's nothing that stops one from reading the plugin.yml earlier and just keeping the file streams open till plugin loading is necessary

#

not like it is gonna take a lot of resources to keep them open

young knoll
#

Well you can make a PR :p

eternal oxide
#

unless you are on a shitty bsd system with a low file count

sly topaz
#

nor paper for the matter, I just hang around in the minecraft communities

eternal oxide
#

He's a spy!

glossy laurel
young knoll
#

pull request

upper hazel
#

recommend any good gui api

eternal night
#

interfaces is nice

#

IF exists too

glossy laurel
#

Fr

eternal night
#

would benefit from components

#

I think

upper hazel
worldly ingot
remote swallow
#

maybe someone named @river oracle would make a new pr and update it

quaint mantle
#

You know how some mods allow to close gui without packets? Is there a way to detect that?

eternal oxide
#

If no packet is sent, no

eternal oxide
#

If its a client mod thats closing the inventory and not sending a packet, there is no way for the server to detect that

quaint mantle
#

Do you think I can do anything based off the clip?

eternal oxide
#

no

#

All you can do is check if the inventory click event relates to the currently open view

#

If the client is not notifying of any close then the server can;t tell

slender elbow
#

creative mode ๐Ÿ’€

quaint mantle
#

Their server got duped on soo they are pretty sure it works in survival no op

chrome beacon
#

Recreate in survival

worldly ingot
slender elbow
#

creative mode should just straight up be deleted from the dedicated server

#

can't wait to patch that into spigot

worldly ingot
#

Who even needs creative mode

#

Who even needs survival mode?

#

That shit's just Minecraft with extra steps

#

Why isn't the whole game just adventure mode?

quaint mantle
#

Watching the lovely Parrots

#

While my friend takes a video of that in survival

#

I had my own solution to it

#

Adding an nbt tag to it when its inside the inventory

inner mulch
#

why are there base java classes that inherit from multiple classes?

river oracle
remote swallow
#

im not talking about bootstrapping

river oracle
#

I know

#

but what you're talking about involves the loader

#

cbf atm

remote swallow
#

theres an existing pr doing it

slender elbow
#

"a tad" :copium:

remote swallow
eternal oxide
#

we need a whip emote

remote swallow
river oracle
#

well the plugin loader is a bit of a mess already considering it allows circular dependencies

river oracle
#

Wonder how many plugins would break by dissallowing circular dependencies ๐Ÿ˜‚

remote swallow
#

atleast 60

slender elbow
#

@eternal night thoughts?

#

his dumb ass is OFFLINE

remote swallow
#

paper deprecates paper-plugin.yml when?!

river oracle
#

paper-plugin.yml is unequivacly based, probably, idk haven't looked at it

quaint mantle
#

You can create yml in build files now right?

river oracle
#

but I assume its great!

remote swallow
#

no clue about maven

river oracle
#

with gradle maybe

quaint mantle
#

yea with gradle

river oracle
#

probably not maven I doubt theirs a plugin for maven

quaint mantle
#

I love Maven but gradle has the cool stuff

river oracle
#

if I used maven I honestly would rather write my file in YML kekw

remote swallow
eternal oxide
#

There is an annotation API for plugin.yml

#

if you are too lazy to write one

eternal night
#

I don't have thoughts on his work that just brings features paper has had for years to a dead project

river oracle
eternal night
river oracle
#

I am a pure spigot user I do not dabble in the dark arts

eternal night
#

Would a pure spigot user want components

#

Exactly

#

A fraud

river oracle
#

yes yes they would

#

because they understand components are based as hell

eternal night
#

No, we all know legacy is superior

#

Or smth like that

river oracle
#

legacy is actually great because...

#

uhm you get to type &4 instead of <dark_red>

quaint mantle
#

Tbh components are better

river oracle
#

and like &l instead of <bold>

slender elbow
#

legacy is actually readable

quaint mantle
#

It makes readability better

slender elbow
#

ยงxยง0ยง0ยงFยงFยงEยง0mยงxยง0ยงDยงFยง1ยงEยง2eยงxยง1ยงAยงEยง3ยงEยง3oยงxยง2ยง7ยงDยง5ยงEยง5w ยงxยง4ยง1ยงBยง8ยงEยง9mยงxยง4ยงEยงAยงAยงEยงAeยงxยง5ยงBยง9ยงCยงEยงCoยงxยง6ยง8ยง8ยงEยงEยงEw ยงxยง8ยง3ยง7ยง1ยงFยง1mยงxยง9ยง0ยง6ยง3ยงFยง3eยงxยง9ยงDยง5ยง5ยงFยง5oยงxยงAยงAยง4ยง7ยงFยง6w ยงxยงCยง4ยง2ยงBยงFยงAmยงxยงDยง1ยง1ยงCยงFยงCeยงxยงDยงEยง0ยงEยงFยงDoยงxยงEยงBยง0ยง0ยงFยงFw

slender elbow
#

it's perfectly readable

river oracle
quaint mantle
#

No its not

river oracle
#

yeah it is are you dense??

quaint mantle
#

idk

river oracle
#

bro hasn't been outside his "walled" garden

quaint mantle
#

I like using string templates with components

worldly ingot
#

It's part of composition

eternal night
#

Real, cool kids like us know that anything remotely XML like is unreadable garbage

river oracle
#

obviously

#

minimessage format is garbo

eternal night
#

We actually use lynxdown

#

Proprietary format implemented in native rust

river oracle
#

@worldly ingot so you're making us a mini message parser next right???

river oracle
quaint mantle
#

i just do MM.string for mini messages

eternal night
#

Oh no, it's incompatible with spigot

#

๐Ÿ˜ฆ

worldly ingot
#

That was unironically the plan. Just sucks that my job is made more difficult by MM being directly part of Paper now instead of its own repo

#

Gotta start from scratch

eternal night
#

What

river oracle
eternal night
#

MM isn't in paper, it's just shaded in

quaint mantle
#

How did components come into play anyways?

worldly ingot
#

The repository is dead, no?

eternal night
#

It moved to adventure itself

worldly ingot
#

It's part of Adventure now

eternal night
#

Not paper

worldly ingot
#

Yeah

slender elbow
#

minimessage ๐Ÿ’€

quaint mantle
#

Whats wrong with mini message?

slender elbow
#

unreadable asf

#

legacy on top

#

like what kind of color is dark_red ????

eternal night
#

Yea so like, fork and off ya go lol. Adventure licence is MIT

worldly ingot
#

I would have made and maintained a BungeeChat module if it were still in its own repo

quaint mantle
worldly ingot
#

Now it's pretty tightly knit into Adventure

eternal night
#

Oh I'd just fork

#

Call it chocomessage

#

For good measures

slender elbow
#

MiniChoco

eternal night
#

Message

quaint mantle
#

ChocolateyMessage

river oracle
#

Don't worry guys PineappleChat to the rescue

#

its definitely not my first ever parser and its definitely not scuffed

worldly ingot
river oracle
#

and its definitely as capable as minimessage

quaint mantle
#

SneakyChat

inner mulch
worldly ingot
#

Yes

inner mulch
#

i got baited

river oracle
#

@eternal night You guys are late on your payment this month hurry up or I'll start patching CabernetMC

slender elbow
#

carbonaramc

eternal night
river oracle
#

I willl also monopolize uhm taco related PRs

eternal night
#

Btw, on a scale of smart to not smart, where do you put naming something ViewBuilder

#

What view miles, what view are we building

eternal night
#

An array list view? A spigot bstats view?

#

A croissantmc view

river oracle
#

I should rename it to MenuBuilder for maximum inconsitency

eternal night
#

Exactly

#

Now you are thinking like a real spigoteer

river oracle
#

honestly might PR rename InventoryView to Menu and then ofc we just do some Commadore and patch it all up

#

๐Ÿ’ช god commadore is great time to break some more things

river oracle
#

I just didn't feel like typing all that out

#

like that's a lot to ask of me you know

eternal night
#

Yea but given no sane human will ever actually store it, it can be a bit more verbose

#

Especially with a name as generic as View

echo basalt
#

InventoryViewConstructor

river oracle
#

๐Ÿ’€ nah homie

echo basalt
#

we need more standards

eternal night
echo basalt
#

InventoryViewProviderConstructorBuilder

worldly ingot
river oracle
#

I haven't tested any of that PR yet, I hope it actually works when I feel like testing it

echo basalt
river oracle
eternal night
#

That's what reviewers are for

echo basalt
#

CraftEvil

echo basalt
eternal night
#

I did wanna see how long we can survive without anyone noticing we haven't pulled spigot

echo basalt
#

just type some random sentence in chinese characters

eternal night
#

Current record iirc is 2 months

river oracle
#

dayumm

#

I need to start adding stuff

#

I feel like everything I add ends up already being in paper no matter how hard I try though

#

the feeling of defeat

eternal night
#

Hey, we are always looking for more contributors over at he who must not be named

blazing ocean
#

go merge my pr smh

river oracle
#

and held me hostage

echo basalt
#

alr bet

#

omw

eternal night
#

Was about to say

eternal oxide
#

Y2K_ blushing now

eternal night
#

Sounds like a challenge

river oracle
eternal night
#

๐Ÿ˜‹

river oracle
#

wait no it probably loses money that's not a great idea

blazing ocean
#

lmfao

eternal night
#

How much of spigot do you own rn

river oracle
eternal night
#

Fair

echo basalt
#

@sullen marlin can i have 10% share for my uh

river oracle
echo basalt
#

greed

river oracle
eternal night
#

Beyond that iirc good enough

echo basalt
#

where's your pinned post

river oracle
#

low PR to yap ratio here

blazing ocean
#

hey lynx whens my pr getting merged

eternal night
#

Was a bit iffy on constructing the container before the builder

#

But eh

remote swallow
#

rad paper pr?!?!?1

#

RAD HOW COULD YOU

eternal night
echo basalt
eternal night
#

As a "meh" PR it's kinda there

blazing ocean
#

meh is crazy

river oracle
blazing ocean
#

its essential for stuff im doing

eternal night
#

Well you know what I mean XD with the whole "it kinda just guesses"

remote swallow
#

RAD

eternal night
#

?whereami

eternal night
#

This is the spigot discord ebic

remote swallow
#

dont care

blazing ocean
eternal night
#

Ruthless

remote swallow
blazing ocean
#

i am not a piece of paper

remote swallow
#

you want to be

river oracle
#

some people here have signed the CLA you know

remote swallow
#

I HAD TO EXPOSE HIM

river oracle
#

I'll die if I click that

remote swallow
#

you can click it you just cant read anything

#

@blazing ocean go sign the cla

blazing ocean
#

nah im good

river oracle
carmine spoke
#

I thought I survived http based repositories until I used BuildTools ๐Ÿ˜ข

Could not transfer artifact org.spigotmc:minecraft-server:pom:1.8.8-SNAPSHOT from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [md_5-releases (http://repo.md-5.net/content/repositories/releases/, default, releases+snapshots)] -> [Help 1]
eternal night
#

I'll read over it tonight, I have some paper work first but after that I got some spare time

#

Http smeku

carmine spoke
#

someone should fix this outdated garbage

remote swallow
#

1.8.8

eternal night
#

Yea, so you fix this

#

By using 1.21.1

river oracle
#

1.8.8

blazing ocean
#

1.8.8 is the outdated garbage

eternal night
#

Instead of outdated garbage

remote swallow
#

his repo is https too

#

so the issue is your outdated

river oracle
blazing ocean
#

real

carmine spoke
#

I forgot I'm using 10 years old jar for a moment lmfao

river oracle
eternal night
#

Isn't that your project???

river oracle
eternal night
#

Click the role button

remote swallow
#

lynx is it k8s paperwork

eternal night
#

Easy fix

remote swallow
#

or is it taxes

river oracle
#

gonna take all bug reports etc there

eternal night
#

Ah fair, makes sense

eternal night
remote swallow
#

hes gonna lock all the paper channels

#

only cabernetamcmers in thepapermc discord

remote swallow
#

what paperwork is it

river oracle
#

the biggest slap in the face would be stealing their majority market share infront of their own eyes

#

that's why I'm doing it

#

๐Ÿ’ช

eternal night
#

Facts, single person maintained projects do well

river oracle
remote swallow
#

cant believe papermc wastes so much paper making a random contributor print 900 pages for something

eternal night
#

Especially when maintained by a machine like you

#

๐Ÿ’ช

remote swallow
#

some would even say hes a machine maker

river oracle
#

plus I'm down 1 owen so its basically 15x development

remote swallow
#

miles did you forget something

river oracle
#

I have one EpicEbic to so its pretty much 12x development

remote swallow
#

miles who sleeps on ur far left

eternal night
river oracle
remote swallow
#

no that would be left, not far left

river oracle
#

usually my GF does, but otherwise it'd be owen

remote swallow
#

or do you social distance while asleep

remote swallow
#

you arent down 1 owen

river oracle
#

Yeah but he's an intellectual

#

he would never touch CabernetMC

remote swallow
#

what if he was friends with paper owen

#

and owen told him to sabotage

river oracle
eternal night
#

A lot of circular dependencies

remote swallow
#

thats one way to say hes inbred

river oracle
#

Hey wait I don't think I have the jurastiction to be making fun of owen unfortunately

#

so I should probably apologize

remote swallow
#

lynx endorses it so its fine

eternal night
#

Well, as the proud creator of InventoryView#setTitle I indeed think your comments are questionable

river oracle
eternal night
#

DW paper already did

river oracle
#

I've grown so much in the past

#

uhm

#

like 8 months

remote swallow
#

year

eternal night
river oracle
#

don't challenge me

inner mulch
#

what is wrong

#

T doesnt extend anything btw

#

just a generic

#

so enums arent objects?

remote swallow
#

show ur usage

#

if anything you probably want T extends Enum

inner mulch
#

im just gonna use Class

#

without type

#

seems like enums are weird with generics

remote swallow
#

use ?

#

Class<?>

inner mulch
#

doesnt work

#

enum doesnt count as that

#

i can try again

#

maybe cache issue

shadow night
#

Does it compile

slender elbow
#

Class<Enum> is indeed not Class<Object>

#

it is not a cache issue

#

it's a your code issue

inner mulch
#

okay after cache clear class<?> works but that isnt really different from Class

eternal night
inner mulch
slender elbow
#

because you seem to misunderstand java generics

inner mulch
#

im making serialization every other serializer uses normal objects but i also have one for enums

#

so Class<T> was pretty cool

#

except for enums

remote swallow
#

this is how i handle enums in part of my config api

inner mulch
#

so
Enum.class == Class<?>

slender elbow
inner mulch
#

but Enum != ?

slender elbow
#

Enum.class = Class<Enum>

#

Enum.class = Class<Enum> = Class<?>

inner mulch
#

yes but java cries about Enum type not being

#

?

#

Enum apperently isnt wildcard

#

๐Ÿ˜ 

slender elbow
#

i can't see your code

#

i can't help you

inner mulch
#

DefaultEnumSerializer is <Enum, SerializedObject>

slender elbow
#

not all wildcards are equal

#

make the method generic

inner mulch
#

this was when it was generic

#

enum != T

#

while T doesnt extend from anything

slender elbow
#

show more code

inner mulch
#

i cant show more

#

i deleted the T stuff

slender elbow
#

ok

inner mulch
#

and made it ?

#

everything that is wildcard was T before

#

but enums seem to not be objects

slender elbow
#

ok good luck

misty garden
#

Hi, who i can import in gradle NMS ?

eternal oxide
#

?nms pretty sure it has a bit at teh bottom for gradle

misty garden
#

this not work for me is normally ?

eternal oxide
#

?fork

undone axleBOT
#

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

eternal oxide
#

?whereami

eternal oxide
#

and IF you are using Spigot run buildtoosl as the link told you

inner mulch
#

is an int[] also Object[]?

shadow night
#

๐Ÿค”

inner mulch
#

can it be cast to that

shadow night
#

You can almost definitely cast it to Object, dunno about Object[] tho, that is why you should

#

?tas

undone axleBOT
blazing ocean
eternal oxide
blazing ocean
#

welp unused

slender elbow
#

int[] is not Object[], however Integer[] is

remote swallow
inner mulch
slender elbow
#

pretty much

misty garden
glossy laurel
#

does something else get called without PlayerInteractEvent when stepping on a pressure plate?

remote swallow
#

what

#

player interact event is called for pressure plate

#

action is phyiscal

blazing ocean
#

ass pressure