#help-development

1 messages Ā· Page 587 of 1

river oracle
#

then use JD-GUI or another FOSS decompiler GUI

vivid cave
#

oki

chrome beacon
#

It seems to be fine. The IDE you're using can decompile

#

Otherwise you wouldn't be able to send the code that you did

river oracle
chrome beacon
#

That's an interface

river oracle
#

oh lol

vivid cave
#

so what do I do ?

vivid cave
chrome beacon
#

First of all what container do you want to look at

vivid cave
#

so inventory container

chrome beacon
#

Then find the PlayerContainer

#

No idea if that's the right name or not

river oracle
#

with love

chrome beacon
#

Then work your way down the inheritance chain until you find the implementation

remote swallow
#

i forgot what theyre called

#

favicon

vivid cave
chrome beacon
#

?

vivid cave
#

nvm

#

i don't find its impl; i'll try another day when i find patience
i can read most nms source code, but i don't find the implementation for this

chrome beacon
#

I can help you find it tomorrow

vivid cave
#

ty :3

chrome beacon
#

Just give me a reminder

vivid cave
#

alrightie :))

young knoll
#

Use the interpolation feature

#

With a duration of 30 ticks

vivid cave
#

i like black magic tbh

chrome beacon
#

Please don't tell me that's particles

vivid cave
#

try again šŸ˜›

#

(it's animated too btw)

young knoll
#

I think it's a display entity with lime glass

chrome beacon
#

Yeah probably

vivid cave
#

nop

#

try again xD

chrome beacon
#

Just tell us :p

vivid cave
#

ok ok

wet breach
#

probably a beam

#

or these frames actually allow specifying a color

vivid cave
#

it's maps, which my plugin animates with ClientboundMapItemDataPacket šŸ˜›

remote swallow
#

?nms

remote swallow
#

mojmaps are the best option

tender shard
#
               ten_toList: avg  0,0023542090 ms / iteration
          thousand_toList: avg  0,0083302920 ms / iteration
           million_toList: avg  5,1132297500 ms / iteration
     ten_collectorsToList: avg  0,0017662080 ms / iteration
thousand_collectorsToList: avg  0,0086735410 ms / iteration
 million_collectorsToList: avg 10,7686530000 ms / iteration
chrome beacon
#

Much better for server performance

remote swallow
#

see what you need it for then just check mappings sites to see what you'll need from them

vivid cave
tender shard
carmine nacelle
#

Im trying to send a packet to update an armorstand's data, struggling a bit.. any ideas?

 List<SynchedEntityData.DataItem<?>> eData = new ArrayList<>();
            eData.add(new SynchedEntityData.DataItem(new EntityDataAccessor<>(6, EntityDataSerializers.POSE), Pose.SLEEPING));

            CraftPlayer craftPlayer = ((CraftPlayer) player);
            craftPlayer.getHandle().connection.send(new ClientboundSetEntityDataPacket(hologram.getHoloIDs().get(curHoloLine), eData));
#

Confused on the line that actually sends the packet to the player

tender shard
vivid cave
#

also it's my map2img feature;
u give one link (gif), and require the size (like 5x3 blocks or whatever), my plugin will: adapt to the desired size (center, take the best proportions based on image size), dither the frames (cuz the palette is pretty restricted to 256 colours), and then animate with packets
One optimisation:
If the client is going under lag, my plugin will responsively adapt frame rate for him AND instead of making him download the frames again and again, he will cache ALL the frames in the client (by making one different itemframe entity/map id for each picture frame), and then spam him "entitymetadatapackets" (which are super light compared to ClientboundMapItemDataPacket) for animation.
That's only if the client is struggling, there is a download rate config which evolves dynamically with their lag.

young knoll
#

I believe you have to set the interpolation duration first

#

Don’t quote me on that tho

#

No

#

Set the scale to what you want it to be after the interpolation duration

#

The final state if you will

carmine nacelle
#

You were the last one I see that figured out how to use this, mind helping me a bit please..?

remote swallow
#

minecraft has 4.8 billion lines of code

#

can someone fact check that

#

4,815,162,342

#

im pretty sure thats billion

young knoll
#

That’s why I unwrap my loops

#

Manually

tender shard
#

or by having useless classes like these lol

keen shell
#

Help needed w/ custom crafting recipe shape

quaint mantle
#

how can I make a text display entity not be static like this and rotate for the client?

young knoll
#

setBillboard

#

You can do horizontal rotation, vertical rotation, or both

carmine nacelle
#

Can anyone help with ClientboundSetEntityDataPacket please

quaint mantle
#

I just used it

carmine nacelle
#

My main issue is how to form the List<SynchedEntityData.DataValue<?>>

green plaza
#

My plugin has 150k soo

carmine nacelle
quaint mantle
#

        val entity = TextDisplay(EntityType.TEXT_DISPLAY, MinecraftServer.getServer().allLevels.first()).apply {
            text = Component.literal(hologramText)
            this.billboardConstraints = Display.BillboardConstraints.CENTER
        }


        val entityMetadataPacket =
            entity.entityData.nonDefaultValues?.let { ClientboundSetEntityDataPacket(hologram.id, it) }

        if (entityMetadataPacket != null) {
            MinecraftProtocol.send(player, entityMetadataPacket)
        }

This is what I do for it

carmine nacelle
# quaint mantle Do you already have a DataWatcher?

I was using datawatchers like this and was told I was doing it harder than it had to be? ```java
for (int curHoloLine = 0; curHoloLine < hologram.getHoloLines().size(); curHoloLine++) {
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);

        Optional<?> opt = Optional.of(WrappedChatComponent.fromChatMessage(hologram.getHoloLines().get(curHoloLine))[0].getHandle());

        WrappedDataWatcher metadata = new WrappedDataWatcher();
        metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), (byte) 0x20);
        metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true)), opt);
        metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), true);
        metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(15, WrappedDataWatcher.Registry.get(Byte.class)), (byte) (0x01 | 0x10 | 0x08));

        packet.getWatchableCollectionModifier().write(0, metadata.getWatchableObjects());

        packet.getIntegers().write(0, hologram.getHoloIDs().get(curHoloLine));

        try {
            protocolManager.sendServerPacket(player, packet);
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
    }
#

Wait wtf

quaint mantle
#

uh I dont use protocol lib so idk

carmine nacelle
#

theres a TEXT DISPLAY entity now??

quaint mantle
#

1.20.1

carmine nacelle
#

are armorstands no longer needed?

tender shard
carmine nacelle
#

yo wtf

#

šŸ‘€

chrome beacon
#

Yeah no more armor stands

carmine nacelle
#

WOOOOOOOOOO

chrome beacon
carmine nacelle
#

LETS GOOOO BABYYY

tender shard
#

theres also block and item displays

carmine nacelle
#

based

#

my plugin is gonna need a major re-write now

carmine nacelle
#

and would they still be created like this?

                ClientboundAddEntityPacket spawnPacket = new ClientboundAddEntityPacket(
                        id,
                        uuid,
                        hologram.getHoloLocation().getX(),
                        hologram.getHoloLocation().getY() - 0.3,
                        hologram.getHoloLocation().getZ(),
                        0.5f,
                        0.5f,
                        net.minecraft.world.entity.EntityType.TEXT_DISPLAY,
                        1,
                        new Vec3(0,0,0),
                        0.25
                );
quaint mantle
carmine nacelle
#

How are you spawning the entity?

quaint mantle
#

Thats just client side

#

So spigot doesn't think there is actually an entity there

#

you should be able to do World#spawnEntity for text display if u want it to be there for everyone

carmine nacelle
#

What if I want to have it show different text for everyone..?

#

or possibly only be visible for some people?

young knoll
#

There’s api to only make it visible to some people

#

Not for per person text tho

carmine nacelle
#

figures

#

thats why i was using packets for everything

vivid cave
#

Why isn't there a SlotType.OFF_HAND ?

#

inconsistency/forgotten ?

#

or is there an actual reason

delicate lynx
#

off hand is just another inventory slot

vivid cave
#

in an inventoryview, each slot are represented by integers
Now InventoryView#getSlotType(slotnb) lets you know what type of slot it is, QUICKBAR, ARMOR, CRAFTING, RESULT, etc

vivid cave
opaque scarab
#

Shields seem to have a ā€œblockingā€ value, specifying if the player is blocking, obviously. The value is not a boolean, but a number. How can I set the blocking value on the shield?

#

Actually, nvm

#

Figured it out

wet breach
#

nor is it inconsistent, it depends which inventory you pulled up

#

if you pull up a player inventory, the main inventory won't contain those slot numbers

#

slot numbers 98 and 99 is for main hand and offhand

#

but, these also correlate to the hotbar

#

so, slot 98 is not only main hand, but its the first slot in the hotbar

#

and not only that to go further, main hand doesn't actually exist since its just any item they have selected from the hotbar

#

now, that is for players

#

since players are entities, you couldn't apply these slot numbers for entities

#

so you would need to change the inventory API to conform to that instead of the way it is now

vivid cave
#

fair

#

i see

#

SlotType.QUICKBAR slots appears in every inventory

#

so that explains its existence

wet breach
#

indeed, but slot number 98 is ambigious as its just any item in the hotbar selected. Its not a specific slot itself

vivid cave
#

what is its SlotType ?

wet breach
#

weapon or weapon.mainhand

vivid cave
#

hm ?

#

doesn't exist

wet breach
#

I know, but that is its type, it doesn't exist because slot 98 could be referring to the item in slot 2

#

because that is what the player has currently selected

vivid cave
#

but what does InvView.getSlotType(98) responds ?

wet breach
#

I have no idea, probably give you some generic thing or nothing at all

vivid cave
#

hmm

wet breach
#

?tas

undone axleBOT
vivid cave
#

meaning that there will only be 8 slots responding QUICKBAR ?

wet breach
#

98 is main hand, 99 is offhand

vivid cave
#

thats 9 xd

wet breach
#

anyways, now you know something as mundane as slot type can get you a nice look into some intricacies šŸ˜›

vivid cave
#

haha

wet breach
#

stay here longer and you might very well learn more things you didn't know lol

vivid cave
#

i love esoterism

vivid cave
#

i feel like i'm sometimes going too deep in some stuff here

wet breach
#

yeah poke too much and you get these nice rabbit holes

#

some are shallow and others seemingly just go on forever

vivid cave
#

yeahh

#

i like it tho

wet breach
#

yeah it can be fun especially when you learn there is something you could actually make use of that isn't quite known

#

there is a lot in the code API and NMS that you can make use of in a variety of ways and really just comes down to knowing about it, and your skills to use it or apply it

#

it was fun for me when I helped introduce holograms to the game šŸ™‚

#

making use of that horse age bug someone found and turning that into a feature in a plugin

#

now, its permenently part of MC šŸ˜„

young knoll
#

Does the interpolation not work?

#

Hmm

#

Try also calling setInterpolationDelay(0)

#

Before you set the duration

#

The item doesn’t matter

#

Any item can have pdc

#

Try delaying everything 1 tick from when you spawn it

#

Sorry not pdc

#

cmd

#

CustomModelData

#

Might work, if not use a scheduler

#

It’s a value designed specifically for texturing

#

I assume paper was chosen as it’s just a nice basic item that doesn’t do anything special

#

I don’t think you can detect that

#

Maybe

tender shard
#

depends what the method does

#

why are you spawning a new display on every tick instead of reusing the existing one

tender shard
#

🧠

river oracle
# tender shard 🧠

my new plugin called AsyncLagCreator creates Display entites every tick for 2000 ticks than starts spawning ender dragon spawners at random positions in loaded chunks

#

I plan to release it as a premium plugin for $15

tender shard
#

dude are you trolling

#

you shouldn't sell it for less than 40$

#

Entity#getTicksLived()

quaint mantle
#

Hi, I've got a problem.
I'm trying to make a spigot fork (don't ask why, I just need to do it for a server)
But when I try to install mvn clean install, it cannot find org.spigotmc:minecraft-server

BuildTools is not downloading it or is there something I should do?

river oracle
#

clear the caches and try again

quaint mantle
#

Sorry, I think I don't know what "clear caches" mean, is it removing local maven repo?

river oracle
#

BuildTOols creates directories

#

delete them

quaint mantle
#

So I have to build again? šŸ’€

river oracle
#

yeah

#

though also while your at it :P try out the new bt gui

quaint mantle
#

I see, everything is a conspiracy so that we must use the new buildtools gui 😈

tender shard
quaint mantle
tender shard
#

try building bukkit and craftbukkit before with mvn install

quaint mantle
#

In that same order, or it doesn't matter?

#

Nvm, the same error when trying to compile craftbukkit

#

Agh

#

My bad

#

IntellIj not using the same repo as the one I have for mvn

#

Like some weird configuration I have there

#

NOWNAD
No f##### way, it's empty

young knoll
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

quaint mantle
river oracle
#

which of these images is correct lol

quaint mantle
#

Yellow numbers

#

The second one

river oracle
#

thank

quaint mantle
#

I hate how minecraft inventory slot numbers are done

#

They are confusing

tender shard
#

41, ... 44 is crafting, 45 is result

calm robin
#

How can I put listeners in a class where there are multiple instances of that class and have the listener in each instance of the class have access to the memeber variables?

calm robin
#

1 sec

#

i have this class

#

each player has an instance of this class

#

i have implements listener and register the events in this class

#

but

#

when that listener gets called

#

it thinks player is null

#

it doesnt have access to the specific player member variable of that instance

#

how can i fix this

quaint mantle
#

First of all, why do you add a listener for each player?

calm robin
#

its just the way im doing it

quaint mantle
#

You should think about changing it

calm robin
#

maybe, but if i can fix this i would rather do it this way

quaint mantle
#

If you have a custom even, it's because you have an API

#

No one will want to use an API which requires a player for even handling, instead of obtaining the players on the event

#

Anyway

#

A possible fix might be to use player UUID instead of player object

#

I also see that you have an empty constructor

#

If you create an instance using that empty constructor, then the player will be always null

calm robin
#

ok

#

im guessing the problem is that when i register the events, it does not register all the new instances im creating

#

registering the new events when i make a new instance is just going to get messy and not worth it

#

ill be switching up how i approach this

elfin tusk
#

After using the sendBlockChange method on a player skull and updating the block after, changing it back to a player skull, the skull is the default Steve head. Which packet is the right one to update the skull with the NBT? I've noticed that rejoining fixes it and that the texture remains in the skull's NBT after updating it again so I'm unsure on what the issue is.

echo basalt
#

Skull heads are tile entities

#

So it could be something to do with that

young knoll
#

There’s a new api for that iirc

#

sendBlockUpdate

elfin tusk
#

I'll try them, thank you both.

carmine nacelle
#

So are text entities the new way to do holograms?

young knoll
#

Yes

#

They are just armor stands but better in every way

carmine nacelle
#

I can’t figure out how to efficiently update their data

young knoll
#

?

carmine nacelle
#

With Mojang mappings

young knoll
#

Is it different than armor stands

carmine nacelle
#

Not sure but I can’t figure out how to update armorstands either without protocollib

#

I was told protocollib sucked and to use mojang mappings instead so

young knoll
#

Meh, no one is forcing you to

#

You can also try PacketEvents

carmine nacelle
#

Well if it’s the ā€œproperā€ way to do it then I wanna do it

elfin tusk
echo basalt
#

ProtocolLib is good

#

PacketEvents is meh

carmine nacelle
#

I just can’t find a working example ANYWHERE

echo basalt
#

You were probably told by retrooper that plib sucks

#

NMS is fine

#

Bukkit API best

#

Display entities don't need to tick afaik

young knoll
#

They don’t tick, no

#

But you still can’t make them different per player with the api

carmine nacelle
#

How do you send spawn/metadata packets with bukkit api?

#

Oh

#

Yeah I need the text and visibility to be per player

echo basalt
#

You don't need to do it with packets

elfin tusk
echo basalt
#

player#hideEntity is a bukkit thing

echo basalt
#

But sure if you want it to be with players

carmine nacelle
#

And what about text..?

elfin tusk
#

I am using NMS currently, but I can't find the correct packet to send.

echo basalt
#

you could spawn multiple entities

carmine nacelle
#

Ewwww…

#

lol

echo basalt
#

But that can be annoying

young knoll
#

Idk I like packet events because I can shade it

#

API wise plib does seem a bit nicer tho

echo basalt
#

tinyprotocol

young knoll
#

Wha that

echo basalt
#

protocollib's shadeable thing

young knoll
#

Oh

#

Neat

echo basalt
#

That's basically just a listener

young knoll
#

Is it version independent

echo basalt
#

uhh

#

great question

#

doubt

young knoll
#

Actually I doubt it matters

#

I’ll still need to update PacketEvents too

carmine nacelle
#
    public void setHoloData(Player player, Hologram hologram) {
        for (int curHoloLine = 0; curHoloLine < hologram.getHoloLines().size(); curHoloLine++) {
            PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);

            Optional<?> opt = Optional.of(WrappedChatComponent.fromChatMessage(hologram.getHoloLines().get(curHoloLine))[0].getHandle());

            WrappedDataWatcher metadata = new WrappedDataWatcher();
            metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), (byte) 0x20);
            metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true)), opt);
            metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), true);
            metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(15, WrappedDataWatcher.Registry.get(Byte.class)), (byte) (0x01 | 0x10 | 0x08));

            packet.getWatchableCollectionModifier().write(0, metadata.getWatchableObjects());

            packet.getIntegers().write(0, hologram.getHoloIDs().get(curHoloLine));

            try {
                protocolManager.sendServerPacket(player, packet);
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            }
        }

        PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);

        WrappedDataWatcher metadata = new WrappedDataWatcher();
        //metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), (byte) 0x20);
        //metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), false);
        metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(15, WrappedDataWatcher.Registry.get(Byte.class)), (byte) (0x01 | 0x08));

        packet.getWatchableCollectionModifier().write(0, metadata.getWatchableObjects());
        //packet.getIntegers().write(0, hologram.getHoloIDs().get(curho));

        try {
            protocolManager.sendServerPacket(player, packet);
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
    }
#

This was how I updated the hologram info before

#

it just doesnt work anymore

echo basalt
#

Yeah you can get rid of the datawatcher

carmine nacelle
#

wasnt elegant but it worked

#

Happen to have a current example..?

echo basalt
carmine nacelle
#

I just wanna spawn a text entity for a specific player and set its text

#

I think that might help with my main issue

torn shuttle
#

what happened to the search index?

#

sad!

echo basalt
#

I still use search index

#

It's just that I posted this before search index was a thing

torn shuttle
#

oh so you regressed

echo basalt
#

no comment

torn shuttle
#

he's returning to monke

echo basalt
elfin tusk
#

Ah I found out my issue, I was converting the wrong thing to a TileEntitySkull. Thank you for the help.

quaint mantle
#

?paste

undone axleBOT
glad prawn
#

?sendyourcode

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

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

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

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

names Show previous names and nicknames of a member.
userinfo Show information about a member.

__**ModLog:**__

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

__**Permissions:**__

permissions Command permission management tools.

glad prawn
#

šŸ˜‚

elfin tusk
#

Me?

#

?okay

#

?haveaniceday

silent steeple
#

p.sendMessage(aHCF.getInstance().getConfig().getString(ChatColor.translateAlternateColorCodes
('&', "ability-items.usage-message")).replace("%item%", i.getItemName()));

ability-items:
global-cooldown: 10
usage-message: "&eYou have successfully used %item% &eand you are now on cooldown for %cooldown%."

why is it not changing the color codes into colors

rough ibex
#
ChatColor.translateAlternateColorCodes('&', "ability-items.usage-message")```
#

you're just passing a string

#

you mixed up your call order.

silent steeple
#

huh

#

its very late im lost

rough ibex
#
p.sendMessage(
  ChatColor.translateAlternateColorCodes(
    '&',
    aHCF.getInstance().getConfig().getString("ability-items.usage-message")
  )
).replace("%item%", i.getItemName());
silent steeple
#

oh 😭

#

thanks

rough ibex
#

you did translate -> getString

#

when you should have done getString -> translate.

#

no problem

dim sandal
#

whats the event fired when a small fireball from a blaze hits a block?

#

ive been searching for like 20 mins and cant find it

carmine nacelle
carmine nacelle
drowsy helm
#

isnt java great

echo basalt
chrome beacon
drowsy helm
#

just tryna do some funky function stuff and avoid reflection lol

glad prawn
drowsy helm
#

looks like my ide is just shitting itself

quaint mantle
#

sometimes when writing rust in intellij it puts "Loading error.." errors on random lines

carmine nacelle
#

found it finally

humble tulip
#

Lmfao

#

Writing packets with protocollib can be so stupid sometimes

echo basalt
#

no its just lack of knowledge

echo basalt
quaint mantle
#

Do display entities havce a max text length

echo basalt
#

The getIntegers getWhatever are fields present in the packet class

#

In this case you want to set text, which is a Chat (component) type at index 22

#

So you do a Registry.getChatComponentSerializer and you pass the text

carmine nacelle
#
            List<WrappedDataValue> dataValues = List.of(
                    new WrappedDataValue(22, WrappedDataWatcher.Registry.getChatComponentSerializer(), (byte) 0x40)
            );
#

so like that

echo basalt
#

Why are you writing 0x40

carmine nacelle
#

Im trying to figure out what needs to go there lol

#

thats what you had in your example

echo basalt
#

That's because in my example, 0x40 was the bitmask for the invisibility thing

carmine nacelle
#

hmm alright...

#

not sure what id put there

echo basalt
#

First parameter is the index defined on the metadata page

carmine nacelle
#

this seems more complex than it should be lol like why cant I just say I wanna set index 22 to "Testing" and it just work

echo basalt
#

Second parameter is the serializer for the 3rd parameter

carmine nacelle
#

Ok how do I know what to use for the serializer?

echo basalt
#

It's in the page..

#

This is the first parameter (index)

carmine nacelle
#

yeah I got that part

#

Oh so it just goes off the type column..

echo basalt
#

You'll want a serializer of this type in the second parameter

#

And a variable of that type in the 3rd parameter

#

Use the Meaning to understand what the variable does

#

In this case you want a value of index 22, of the type Chat

#

Chat's serializer is Registry.getChatComponentSerializer

carmine nacelle
#

So for varInt, I dont see a Registry# for that, or is there not one for that..?

echo basalt
#

And if you have a chat component serializer.. you want to serialize.. chat components

#

varint is just int

carmine nacelle
#

ah

echo basalt
#

different encoding but in terms of serializers it's the same

carmine nacelle
#

but what serializer do you use for it tho?

echo basalt
#

Registry.get(Integer.class)

carmine nacelle
#

Oh lol

#

easy enough

#

So what about this part..?
metadata.getIntegers().write(0, player.getEntityId());

echo basalt
#

That's... the id of the entity whose metadata is being applied to

carmine nacelle
#

Whats the 0 about?

echo basalt
#

If you look at the packet class, it's the first field

carmine nacelle
#

gotcha

echo basalt
#

this mf

carmine nacelle
#

I see I see..

#

new WrappedDataValue(22, WrappedDataWatcher.Registry.getChatComponentSerializer(), WrappedChatComponent.fromChatMessage("Test"))

#

Is there something else you gotta use to set text values?

echo basalt
#

Don't think so

carmine nacelle
#
Internal Exception: io.netty.handler.codec.EncoderException: java.lang.ClassCastException: class [Lcom.comphenix.protocol.wrappers.WrappedChatComponent; cannot be cast to class net.minecraft.network.chat.IChatBaseComponent ([Lcom.comphenix.protocol.wrappers.WrappedChatComponent; is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @24c8a521; net.minecraft.network.chat.IChatBaseComponent is in unnamed module of loader java.net.URLClassLoader @1ed6993a)
echo basalt
#

How fun

#

you might need to call getHandle

carmine nacelle
#

On which specifically?

echo basalt
#

the wrapped chat component

carmine nacelle
#

Am I dumb?

echo basalt
#

ah

#

do fromText instead

#

fromChatMessage returns an array

#

no need for getHandle then

carmine nacelle
#

same error lol

echo basalt
#

then yeah gethandle

carmine nacelle
#
: Squallz lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.ClassCastException: class com.comphenix.protocol.wrappers.WrappedChatComponent cannot be cast to class net.minecraft.network.chat.IChatBaseComponent (com.comphenix.protocol.wrappers.WrappedChatComponent is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @768dcebd; net.minecraft.network.chat.IChatBaseComponent is in unnamed module of loader java.net.URLClassLoader @1ed6993a)
echo basalt
#

Welcome to entity metadata

carmine nacelle
#

YAYYYYY

#

KILL ME

#

LES GOOOO

#

I broke it lol

#

So im trying to make it so rotate with you, and be visible from both sides. By default it sits still and you can only see it from one side

young knoll
#

Well I know the api methods for that :p

#

Have fun

quaint mantle
#

Do display entities havce a max text length

quaint mantle
carmine nacelle
quaint mantle
carmine nacelle
#

Is there a way to make the background less dark? I see background color, text opacity and Is See Through

echo basalt
#

opacity

carmine nacelle
#

Yeah but im not seeing a background opacity?

echo basalt
#

Should be text opacity

#

set it as 128 and see where you'll end up

carmine nacelle
#

that made the text white instead of red lol

#

and the background is just as dark

#

new WrappedDataValue(25, WrappedDataWatcher.Registry.get(Byte.class), (byte) 128)

wet breach
quaint mantle
#

yo @carmine nacelle i set mine to 0

#

and it works

wet breach
#

Not background lol

quaint mantle
#

clear

carmine nacelle
#

set what to 0?

quaint mantle
#

the opacity

wet breach
#

You could set default color to 1 in index 26 for bitmask

#

And see through to 1

#

If you are trying to make it not see through

carmine nacelle
#

new WrappedDataValue(25, WrappedDataWatcher.Registry.get(Byte.class), (byte) 0)

#

sadge, black background still

wet breach
carmine nacelle
#

26 and see through..?

wet breach
#

Set the byte for 26 to 00010100

carmine nacelle
#

new WrappedDataValue(26, WrappedDataWatcher.Registry.get(Byte.class), (byte) 01010000)

#

it wanted me to change it to a decimal literal

wet breach
#

40

#

Is in the int equivalent

echo basalt
#

0b00010100

carmine nacelle
#

new WrappedDataValue(26, WrappedDataWatcher.Registry.get(Byte.class), (byte) 0b00010100)

#

same thing

wet breach
#

Use int 40

carmine nacelle
#

new WrappedDataValue(26, WrappedDataWatcher.Registry.get(Byte.class), (byte) 40)
like literally like that?

echo basalt
#

yea

wet breach
#

Yeah

carmine nacelle
#

no work

#

lol

wet breach
#

Interesting

carmine nacelle
#

we cant figure this out

quaint mantle
# carmine nacelle got a code example? lol
        val entity = TextDisplay(EntityType.TEXT_DISPLAY, MinecraftServer.getServer().allLevels.first()).apply {
            text = Component.literal(hologramText)
            this.billboardConstraints = Display.BillboardConstraints.CENTER
            this.backgroundColor = 0
        }
carmine nacelle
#

rip

#

different than my setup

quaint mantle
#

val entity = TextDisplay(EntityType.TEXT_DISPLAY, MinecraftServer.getServer().allLevels.first()).apply {
text = Component.literal(hologramText)
this.billboardConstraints = Display.BillboardConstraints.CENTER
this.backgroundColor = 0
}

    val entityMetadataPacket =
        entity.entityData.nonDefaultValues?.let { ClientboundSetEntityDataPacket(hologram.id, it) }

    if (entityMetadataPacket != null) {
        MinecraftProtocol.send(player, entityMetadataPacket)
    }
#

thats all i do

#

Im just sending the packet I just create a TextDisplay so i dont need to deal with entityData

#

u should try it

carmine nacelle
#

I need per-player text

quaint mantle
#

yeah thats fine

#

thats what i do\

#

you just send the packet to specific ppl

#

You see I never spawn the TextDisplay

carmine nacelle
#

I feel like theres gotta be a way to do it with my layout..

quaint mantle
#

Whats ur layout

carmine nacelle
#
            PacketContainer metadata = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);

            List<WrappedDataValue> dataValues = List.of(
                    new WrappedDataValue(22, WrappedDataWatcher.Registry.getChatComponentSerializer(), WrappedChatComponent.fromText(ChatColor.RED + "Test").getHandle()),
                    new WrappedDataValue(14, WrappedDataWatcher.Registry.get(Byte.class), (byte) 3),
                    new WrappedDataValue(26, WrappedDataWatcher.Registry.get(Byte.class), (byte) 40)
            );

            metadata.getIntegers().write(0, hologram.getHoloIDs().get(curHoloLine));
            metadata.getDataValueCollectionModifier().write(0, dataValues);

            ProtocolLibrary.getProtocolManager().sendServerPacket(player, metadata);
flint coyote
fleet comet
#

Help me... I remapped 1.20.1 and the classifier remapped-mojang isnt working 😭

Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.20-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexux/content/repositories/snapshots/)``` i ran buildtools with `--remapped`
drowsy helm
chrome beacon
#

And not another version

tender shard
#

and show the output

quaint mantle
#

how can text display's get multiple lines

#

since the text is a string

#

or nms component but its not a list or nothin

drowsy helm
quaint mantle
#

as in text display's in 1.20

#

not quite sure what a hologram display is

drowsy helm
#

oh they just use \n

quaint mantle
#

im pretty sure they dont

#

cuz i put \n earlier in and it didn't work

#

Does Component.literal break that?

smoky anchor
#

I would assume it does lol

chrome beacon
#

From what I can find online \n does work

torn shuttle
#

this is so weird

#

so when I process a blockbench model it faces south incorrectly

#

when it should be facing north

#

and when I add rotations the rotations are still relative to those directions so they're wrong

#

how do I even fix this

smoky anchor
#

make the model in the "wrong" direction so it is correct in the final product
10/10 best solution mhm

torn shuttle
#

at this rate I'll have to release my plugin on wish.com

smoky anchor
#

ew differently scaled pixels

#

does the model engine not have some support or something ?

torn shuttle
#

it's not model engine

smoky anchor
#

wait I thought it was you who was trying to get stuff work with it

torn shuttle
#

the only thing that comes to mind is to manually rotate every single coordinate in a model

#

no I'm making my own model viewer

#

man how did this even happen

smoky anchor
#

Oooh
well that sounds interesting
In that case: can you not just do -angle :D

torn shuttle
#

that fixes the angle but every UV texture faces the wrong side and every origin point is at the wrong location

smoky anchor
#

I remember creating a minecraft clone while using models from blockbench
was quite pain to write model generation from blockbench files so everything is correct
It even has animation support.
Took me weeks

torn shuttle
#

yeah now try to get that to work as a mc plugin

iron palm
#

Hey everyone.
Im trying to migrate to kotlin dsl from groovy for my plugin but im failing

tasks.withType<JavaCompile> {
    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release = targetJavaVersion
    }
}```
in here it says that Val cannot be reassigned
smoky anchor
fluid orbit
#

anyone know how to send packet in 1.19.4?

#

i need "CraftPlayer", but it was removed in 1.19.4 xd

vivid cave
#
InventoryView#countSlots

public final int countSlots()
Check the total number of slots in this view, combining the upper and lower inventories.
Note though that it's possible for this to be greater than the sum of the two inventories if for example some slots are not being used.

Returns:
The total size

Can someone explain me how this can be greater than the sum of the two ?

smoky anchor
fluid orbit
#

Sadly its true

vivid cave
#
    public final int countSlots() {
        return getTopInventory().getSize() + getBottomInventory().getSize();
    }

this is litteraly the source code

smoky anchor
smoky anchor
vivid cave
# vivid cave ``` InventoryView#countSlots public final int countSlots() Check the total numb...

Okay listen, I'm having an issue with InventoryOpenEvent.

@EventHandler
public void invOpen(InventoryOpenEvent event){
    InventoryView inv = event.getView();
    for (int i=0;i<inv.countSlots();i++){
            ItemStack newItem = inv.getItem(i);
    }
}

For example, that makes java.lang.IndexOutOfBoundsException: Index 63 out of bounds for length 63 when i open a single chest (=27 slots) (considering that my inventory is 36 slots, so the limit should in fact be 27+36=63, but countSlots() thinks otherwise)

#

@smoky anchor

smoky anchor
#

I assume the player inventory has slots for crafting, offhand, equipment that are counted in the view but not visible ?

#

I would look at how the getSize for tne inventories is implemented

vivid cave
vivid cave
smoky anchor
#

Just need to check both inventories separately

#

idk if getSize() would work

vivid cave
vivid cave
smoky anchor
#

oh ye right lol

#

well since it seems that you're only getting the items then the getContents will be enough

vivid cave
#

no no no

#

my function was just to highlight the error and i cut off all the unnecessary lines

#

i need to get the slot index because i'm sending SetSlot packets

#

slots index are what interest me most

#

not the actual item in that index

#

i'll think i'll prolly do a while loop and stop whenever it exceeds size

wet breach
#

Just depends on inventory

vivid cave
#

yeah

vital sandal
#

Seeking any help possible ^_^

torn shuttle
#

I'm going crazy

#

I need to take a break and go work out

zealous osprey
#

Always a good idea to take a short, yet very effective, break

torn shuttle
#

I probably need more than a short break, I've been nofilfing this for so long I don't remember how many weeks it's been

zealous osprey
#

._.

tawdry echo
#

its avaible to remove description from it?

zealous osprey
#

"weeks", OOF

torn shuttle
#

now I'm finding myself eyeballing rotations and this sucks

zealous osprey
#

for what? Displayblocs?

torn shuttle
#

armor stands right now, display blocks come next

zealous osprey
#

ah; I also had the intention of making a library to work more easily with those things, cause, fk me, they are weird

zealous osprey
torn shuttle
#

ok finally found the magic number

#

it was 1.395, obviously

#

as you may well have guessed

zealous osprey
torn shuttle
#

these models have layers to how they are wrong, sort of like an onion

hushed spindle
#

seems that downgrading all the way to 2019.3.5 made the problem go away, but certain java features wont work with it lol

tawdry echo
hushed spindle
#

cant do this now for example

drowsy helm
hushed spindle
#

i thought so too

chrome beacon
hushed spindle
#

yeah it didnt work

#

and it got more and more frequent too

#

couldnt even select text without cpu going to 100%

chrome beacon
#

Ouch any other plugins installed?

hushed spindle
#

besides a theme plugin no

#

even so i tried without that one too

drowsy helm
#

and thats on post 2019.3.5?

#

strange

hushed spindle
#

yeah

#

a lot of people have been having this issue for a long time too it seems

#

they just dont know why it happens

#

but yeah, intellij version shouldnt affect compliance level but it does, could it be configuration?

sharp bough
hushed spindle
#

im working on java 17 regardless so that should be fine too right

#

vscode works but intellij's features are just so much more convenient

#

better intellisense too

timid hedge
#

How do i check if a player is in group test.1 or test.2 with luckperms?

chrome beacon
#

Read their documentation

hazy parrot
drowsy helm
#

eh vscode is pretty whack for java

timid hedge
hushed spindle
#

language level is just sdk default

drowsy helm
hushed spindle
#

other options wont go past 13

#

could that be it

hazy parrot
drowsy helm
#

this is quite literally the first paragraph on the api page

chrome beacon
drowsy helm
#

like immediatley after the index

hazy parrot
timid hedge
hazy parrot
#

They sent you screenshot

hushed spindle
#

experimental doesnt include it so i guess its just too outdated

chrome beacon
timid hedge
#

So i got this

    public static String getPlayerGroup(Player player, Collection<String> possibleGroups) {
        for (String group : possibleGroups) {
            if (player.hasPermission("group." + group)) {
                return group;
            }
        }
        return null;
    }

And how do i check if a player is in two of these groups?
if (player.hasPermission(getPlayerGroup().equalsIgnoreCase("Test", "test2"))){

drowsy helm
#

this is pretty basic java man

#
if(isPlayerInGroup(player, "group1") && isPlayerInGroup(player, "group2")

public static boolean isPlayerInGroup(Player player, String group) {
    return player.hasPermission("group." + group);
}```
torn shuttle
#

so close yet so far

#

at least it looks like I fixed the origins

#

it sort of baffles me that the legs have the right rotation and literally nothing else

#

oh I think I finally got it

drowsy helm
#

are you just brute forcing vals until it works lol

torn shuttle
#

uh worse

#

for some reason I found out that inverting all but X values fixes this specific issue

#

for the rotations

#

there's a weird mismatch where it expects to export facing north but ends up facing south

#

and even when I fixed that the rotations had the hardest time figuring out where they were

#

it was 80% math and 20% guesswork

hushed spindle
#

funny little question but is it possible to install language levels into intellij lol

drowsy helm
#

its in the project settings

hushed spindle
#

yeah but theres none past 13

drowsy helm
#

should be there

#

ur intellij just sounds fucked

#

lol

hushed spindle
#

it sure does lmao

drowsy helm
#

what jdk do you have

hushed spindle
#

17

#

oracle openjdk

drowsy helm
#

is that what your project sdk is aswell?

hushed spindle
#

yeah

hazy parrot
#

You also have 17 in maven?

hushed spindle
#

ill double check

#

yup java 17

#

i think im just gonna try to install even more intellij versions and see which one fuckin functions lmao

drowsy helm
#

try re install jdk aswell

#

or just uninstall IJ and use notepad

hushed spindle
#

might as well

green plaza
#

?nms

vivid cave
#

How to:

  • From a Player instance "player", determine whether they are online or not ?
  • From an Entity instance "entity", determine whether they are loaded, or not.
eternal oxide
#

Impossible to have a valid Player instance if they are not online

eternal oxide
#

Fix your code, you shoudl never (cache) players objects

#

they are single use

vivid cave
#

can you please reply to my questions ?

eternal oxide
#

I just did

#

Do not cache Player objects. They are stale once the player log out

vivid cave
#

i don't care

eternal oxide
#

use the Players UUID

vivid cave
#

i don't want that

#

all i care is their ServerPlayer tbh

eternal oxide
#

Then I can;t help you to use teh API incorrectly

vivid cave
#

i don't even use spigot api for my code šŸ˜›

#

i mean

#

i do

#

but not for this

eternal oxide
#

so nms?

hybrid spoke
#

OfflinePlayer#isOnline

vivid cave
#

yep nms

eternal oxide
#

if you have a ServerPlayer its either a Player or an NPC

hybrid spoke
#

doesnt npcs have a flag on them

#

a metadata flag

vivid cave
eternal oxide
#

no flag

hybrid spoke
#

they have a metadata

#

'NPC'

chrome beacon
hybrid spoke
#

yeah

#

screw the others

vivid cave
#

ok now how to determine whether an Entity (and i'm talking about spigot this time) is loaded or not ?

chrome beacon
#

We all know there are a bunch of people copy pasting npc implementations and not adding meta data

eternal oxide
#

Yep they only have meta if you/the plugin add it

hybrid spoke
#

dont they have an isLoaded as well

eternal oxide
#

when you are talking about NPCs all teh rules go out the window

vivid cave
#

or is their a simpler way ?

#

(i'm keeping track of some entities)

hybrid spoke
#

otherwise just listen to the events

vivid cave
#

mk thx!!

chrome beacon
#

I would listen to the events

vivid cave
#

i do it as well; just taking extra measures to ensure i'm not keeping useless cache

#

cache needs to be dynamically updated tbh

chrome beacon
#

You can always weak map them just in case

vivid cave
eternal oxide
#

For Both Player and Entities you shoudl perform all queries by their UUID

shadow night
vocal cloud
#

OfflinePlayer is just a good way to check information about a player to which you don't know if they're actually online or not.

#

or you don't care

shadow night
#

Sounds like a utility useful for like minigames or something

crystal latch
#

Hello I have a problem with Luckperms and Vault, people not OP cannot make the Vault bases commands ( / money, / Baltop ect ...) Do you know that permission is it?

smoky anchor
hazy parrot
shadow night
#

If isAlive in DeadPerson returns true you can cast it to AlivePerson safely too

hazy parrot
#

Well

#

Ig that makes sense ahahahah

shadow night
#

ĀÆ_(惄)_/ĀÆ

timid hedge
#

Why dosent this work?
I am trying to make so if you are in any of these groups it should do something

if(isPlayerInGroup(player, "testGroup1") && isPlayerInGroup(player, "testGroup2" ) && isPlayerInGroup(player, "testGroup3") && isPlayerInGroup(player, "testGroup4")) {
smoky anchor
#

you are checking if the player is in all of those groups
Use the logical OR operator instead.
And learn how logical operators work in... programming I guess

timid hedge
smoky anchor
#

you need to

#

?learnjava

undone axleBOT
smoky anchor
#

But the symbol for logical or is ||

quaint mantle
mossy dock
#

Thanks

quaint mantle
#

okey

river oracle
#

Also not following builder pattern at all

quaint mantle
#

How should be done, i'm new at this

river oracle
spare hazel
spare hazel
smoky anchor
#

might wanna do id (entity.isDead) return;
For less nesting

smoky anchor
#

These constant calls HypixelSkillCore.getInstance().getPlayer & getPlayerAccount are just worsening your performance I bet.
Might wanna create a local variable, unless you have a reason to not create one, in which case I would like to hear it.

spare hazel
#

people are here to complain not help

eternal oxide
#

Not complaining, advice on how best to do things

smoky anchor
#

I am just saying that I would be able to help you faster if I could read the code better.

Anyways, I'd say it looks fine, try to put some more debug lines since the problem is probably in your implementation somewhere else.

smoky anchor
#

unless isDead doesn't return true for dead entity šŸ¤”

#

since the entity might not be dead yet
Check for HP <= 0

spare hazel
#

but even when i damage the entity, it doesnt add xp

spare hazel
#

maybe i should delay it a tick

smoky anchor
#

That does not sound like a good solution.
Probably should have added: check if the entity will be dead if you deal the damage.
so e.getEntity().getHealth() - e.getDamage() <= 0
(after setting the new event damage)

spare hazel
#

alright i will try that one

timid hedge
#

Why dosent my gui open?
I am getting send "debug1" and "debug2"

Main class:

       if (sender instanceof Player) {
            Player player = (Player) sender;
            if(isPlayerInGroup(player, "testGroup1") || isPlayerInGroup(player, "testGroup2" ) || isPlayerInGroup(player, "testGroup3") || isPlayerInGroup(player, "testGroup4")) {
                sender.sendMessage("debug1");
                if (player.getWorld().getName().equalsIgnoreCase("C")) {
                    new ShopIron().open(player);
                    }
                if (player.getWorld().getName().equalsIgnoreCase("B")) {
                    new ShopDiamond().open(player);
                    }
                if (player.getWorld().getName().equalsIgnoreCase("A")) {
                    sender.sendMessage("debug2");
                    new ShopDiamond().open(player);
                    }

ShopDiamond Class:

        gui.setDefaultClickAction(e -> e.setCancelled(true));

            gui.getFiller().fillTop(new ItemBuilder(Material.STAINED_GLASS_PANE, 1, (short) 3).setDisplayName(" ").buildAsGuiItem());

            gui.getFiller().fillBottom(new ItemBuilder(Material.STAINED_GLASS_PANE, 1, (short) 0).setDisplayName(" ").buildAsGuiItem());


            gui.open(p);
    }
}
spare hazel
vivid cave
smoky anchor
#

dude I don't have the source here, I can't check every method call

smoky anchor
smoky anchor
worldly ingot
#

LivingEntity has getHealth(). Not all entities have health

spare hazel
#

theres no such thing

spare hazel
worldly ingot
#

If I can make a suggestion, there's a search bar on the Javadocs here: https://hub.spigotmc.org/javadocs/spigot/. If you're unsure where to find a method or whether a method or class exists, you can search for some keywords there and you'll find it

vocal cloud
#

Based docs enjoyer

worldly ingot
smoky anchor
#

with instanceof

spare hazel
#

okay thanks

fluid river
#

looks weird

undone axleBOT
fluid river
spare hazel
#

1.17.1

ocean hollow
#

Does creating a list in MySQL and working with it heavily overload the system? I need to create a list with String, and then delete some string from all users, will this load the server heavily?

fluid river
fluid river
#

errors in console?

timid hedge
#

Nope

ocean hollow
fluid river
#

also what's inside your Gui class code

#

add a debug before

#

to see if it proceeds to this part

pseudo hazel
#

I mean how do you even save a list in mysql if not with a table

ocean hollow
timid hedge
pseudo hazel
#

as a string? yikes

ocean hollow
fluid river
#

shouldn't it be an Inventory impl

#

cuz you have an open() method there

pseudo hazel
ocean hollow
ocean hollow
#

save as Vitya Bob Maria

pseudo hazel
#

imo its way easier to create a table and then just have the skull ids and like the player id

#

then you can get them using a join on the player id

fluid river
#

how can it possibly load the server

pseudo hazel
#

that too

pseudo hazel
#

well idk what you save

#

looks like player names

ocean hollow
#

yeah

pseudo hazel
#

stored heads

#

yeah

#

just make a table

#

with 2 columns, head name and player id

fluid river
#

i mean your impl is ugly but it would work perfectly

pseudo hazel
#

and then just save it like that

fluid river
#

and won't load your server

#

also do all of your players have the same value in this column?

#

same set of names

ocean hollow
pseudo hazel
#

no there are only 2 columns

fluid river
ocean hollow
#

not

timid hedge
# fluid river cuz you have an ``open()`` method there

It works fine when i am op but when im not its not working

Could it have anything to do with this?

    public static boolean isPlayerInGroup(Player player, String group) {
        return player.hasPermission("group." + group);
    }


if(isPlayerInGroup(player, "testGroup1") || isPlayerInGroup(player, "testGroup2" ) || isPlayerInGroup(player, "testGroup3") || isPlayerInGroup(player, "testGroup4")) {
pseudo hazel
#

if a single player has over 40 heads saving it in a string will be a bit of a pain anyways

#

then you arent using the database to a better potential

fluid river
pseudo hazel
#

im just saying to make a 2 column table column 1 being the name of the head, column 2 being the player id that this head belongs to

#

then you also dont have to get all of a players head anytime you want to add one

#

and you can easily get all heads of a player using simple query logic

fluid river
#

and while having a method getPlayerAccount() you still use it's contents just before using the method itself

chrome beacon
timid hedge
#

I havent seen you have sent anything

chrome beacon
pseudo hazel
#

it would probably have to do with the permission

spare hazel
timid hedge
chrome beacon
#

Then open the luckperms wiki

#

Like I've told you to so many times

fluid river
#

a bit

#

you have this method

#

HypixelSkillCore.getInstance().getPlayer(e.getDamager().getUniqueId()).getCombat().setXp(HypixelSkillCore.getInstance().getPlayer(e.getDamager().getUniqueId()).getCombat().getXp() + 5);

#

you use it instead of this mess you have rn

#
var combat = getPlayerAccount(e.getDamager()).getCombat();
combat.setXp(combat.getXp() + 5);```
spare hazel
#

var????????????????? it isnt javascript

fluid river
#

it's added in java 10

pseudo hazel
#

var is also in java? xD

spare hazel
#

never knew that

pseudo hazel
#

its for when you hate typing annoying type names

fluid river
#

Yes

#

HashMap<List<String>, Integer>

spare hazel
#

leme just add the code you gave me

fluid river
#

you have to write the thing on the right side anyways tho

#

cuz it's not a dynamic type stuff

pseudo hazel
#

yeah it can only infer the correct type

fluid river
#

you have to initialize on the same line where you used var

pseudo hazel
#

then it will just get compiled or preprocessed into the same thing

fluid river
#

ye ye

#

also use pattern matching

#
if (!(e.getDamager() instanceof Player player)) return;
player.doStuff();```
spare hazel
#

@fluid river the thing you said made my code 10x more readable

fluid river
#

cuz i'm a free java lessons guy

#

(checkmybio)

spare hazel
#

already done

#

if(!(e.getDamager() instanceof Player)) return;
if(e.isCancelled()) return;
if(!(e.getEntity() instanceof LivingEntity)) return;

fluid river
#

jree

#

Java Runtime Enterprise Environment

#

truuue

fluid river
#

md_5 should add a link to my profile to ?learnjava

spare hazel
#

and btw why does my server say youre running a server with limited api functionality when enabling essenial?

fluid river
#

?learnjava

undone axleBOT
fluid river
#

true

#

?learnfava where

pseudo hazel
#

can you make all code 10x more readable?

fluid river
#

Only java code sadly

#

And some Unity C# module

pseudo hazel
#

I mean thats still mightly impressive

#

what if I give you code, you optimize it and give it back

fluid river
#

I can also make code 10 times faster and 100 times less readable

pseudo hazel
#

and then I guve it back to you, will it get optimized again?

#

if so that means you can make infinitely good code

fluid river
#

wait what

pseudo hazel
#

which I need

fluid river
#

bruh abusing the matrix right now

pseudo hazel
#

lol

#

your words though

pseudo hazel
#

all code includes your code

#

feelsrecursiveman

alpine urchin
#

your is correct

fluid river
#

i compiled your words in my head

pseudo hazel
#

thats correct

fluid river
#

got OutOfMemoryError

alpine urchin
#

@last temple a simple rule is, if you can replace you’re with you are then you can use you’re

fluid river
#

he's

pseudo hazel
#

the easiest way to be correct is to just say you are everywhere you use you're, if the sentence makes sense its correct to use you're

fluid river
#

you're

alpine urchin
#

same with it’s (it is)

fluid river
#

i'm

pseudo hazel
#

oh

#

lol

fluid river
#

and so on

pseudo hazel
#

wontnt

fluid river
#

your != you're sadly

alpine urchin
#

do you even know a language

#

or are you illiterate

#

jk

#

lol

#

german?

fluid river
#

ikr(i know russian)

alpine urchin
#

nice

fluid river
#

idk how good is my eng

#

somewhere on B2 ig

#

maybe C1

#

never passed an english exam which determines eng level

alpine urchin
#

i think c2 is mother tongue

fluid river
#

C2 is not available for most natives i'm sure

alpine urchin
#

do you think you’re close to mother tongue

fluid river
#

idk what is a mother tongue

alpine urchin
#

look at your moms

fluid river
#

my mom is russian

alpine urchin
#

nice tongue

fluid river
#

i'm c2 in russian

#

know it better than she does

alpine urchin
#

is your english as good as ur russian

fluid river
#

idk lol

fluid river
#

i mean i got 88 out of 100 on state exam

#

i lost all 12 points on "letter"

#
Nice to hear from you again...

Best Regards,
JoeDad```
#

i fucked up all the formatting

#

yeah there should be tabs

#

and i completely forgot about them 2 years ago

fluid river
#

so we can have a conversation

fluid river
quiet ice
#

Yeah I would have forgotten that too

fluid river
#

that's how i lost 12 points

quiet ice
#

Ouch.

fluid river
#

and got 88 out of 100

#

i had no mistakes in the entire test part

#

Conditionals, Times, Forms

#

but fucked up the letter

#

Even my essay was perfect

#

which was like full A4 page

#

english essays are 99 times easier than russian ones

#

there are like 0 commas in each sentence

#

well, i think it's because russian government wants you to use complex sentences in essay, which always require a comma at least once

quiet ice
#

Yeah, english essays are incredibly easy.
German ones, not so much. But that is mainly because I am pretty terrible at my native language

fluid river
#

Well, russian is called hard-to-learn language for a reason šŸ˜‰

#

But it's hard other way than chinese or arabian

#

Chinese has freaking characters

hard socket
#

how can I stop players completly from moving, turning their head etc...?

#

does it have anything to do with packets?

fluid river
#

PlayerMoveEvent#setCancelled(true);

hard socket
#

that wont stop them from turning around

quiet ice
fluid river
#

it would tho

hard socket
#

rly?

fluid river
#

Cuz i was forced to

quiet ice
#

Yeah PME is triggered for head movement

fluid river
#

By school itself

fluid river
#

cuz it does change your location's yaw and pitch

#

and so the move packets are sent to the server

hard socket
#

alr I will look in the source code thanks tho

fluid river
#

the problem is

#

on exam you have to write them line-by-line

#

ordered

#

And the teachers check your order

quiet ice
#

wha

fluid river
#

and if you placed one line before another, they just yell at you and give you F-

torn shuttle
#

I've always heard hilarious things of the chinese education system

fluid river
#

there is a sun character in chinese

torn shuttle
#

basically just a big meatgrinder

fluid river
#

looks like a 8 on a calculator

#

and the order is

torn shuttle
#

isn't that the day kanji in japanese or something

#

it's been a minute

fluid river
#

they are same in both chinese and japanese

torn shuttle
#

oh it is

#

ha

fluid river
#

mean both sun and day

torn shuttle
#

I still have it

fluid river
#

on chinese it's ri

torn shuttle
#

I assume moon is also the same

#

and then month

fluid river
#

but pronounced like zhi

#

on japanese i don't know

torn shuttle
#

is the chinese character for moon and month the same

fluid river