#development

1 messages · Page 22 of 1

dusky harness
#

I mean all packets are is just information passed client <-> server

#

wiki.vg tells you what the packet is about, and packetwrapper tells you how to add it to your code

#

perfect combo

forest jay
#

So, the pickup item packet's id is 65, would I put this? ```java
packetContainer.getIntegers().write(0, 65); // 65 for the id

dense drift
#

no

#

the packet is an (enum) constant

forest jay
#

so its not Packet.Play.Server.ANIMATION

dense drift
#

write(index, value) sets these values

#

PacketType.Play.Server.COLLECT

forest jay
#

ah, thanks

dusky harness
#

just going to show this message again

forest jay
#

I think I can do it from there

#

I just didnt know that COLLECT was the enum

dense drift
#
ints write(0, item entity id)
ints write(1, player id)```
dusky harness
#

and this

#

which is in kotlin but is still readable

forest jay
#

It does not play out the packet, and I doing something wrong? ```java
PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.COLLECT);
packet.getIntegers().write(0, e.getItem().getEntityId());
packet.getIntegers().write(1, p.getEntityId());
ProtocolLibrary.getProtocolManager().sendServerPacket(p, packet);

#

I also know that using ProtocolLibrary.getProtocolManager() is not as good as having an instance, but it is just temporary

dusky harness
forest jay
#

I am running ```java
e.setCancelled(true);
e.getItem().remove();

forest jay
#

oh

#

it does make a difference

forest jay
#

I am removing the entity and then playing a packet using it

dusky harness
#

or I guess remove it right after you play the packet

forest jay
#

yeah

#

sometimes I just don't think

#

alright, that works, thanks! I appreciate your help!

dusky harness
#

np 👍 👍 👍 👍

honest spoke
#

How do you insert into a table with a foreign key in Exposed? The only thing I can find is kt SomeTable.insert { it[someForeignKey] = EntityID(someValue, TableOfForeignKey) }but that results in an error about TableOfForeignKey not being a TypeVariable. I can't find an example of this on Exposed's docs, does anyone know how I'm supposed to do this?

lyric gyro
#

damn

stuck hearth
#

Dirty delete smh

warped sail
#

thx

stuck canopy
#

how can I set a entitiy's velocity to make it move x amount of blocks upwards

bright pier
stuck canopy
#

I know how to set a entity's velocity but what velocity do I set to the entity to make it move x amount of blocks upwards

#

calculating velocity is the thing which im struggling with

bright pier
#

Just get the entity's velocity, then add the difference to the Y axis for how far you want it to move.

stuck canopy
#

aight let me try that

stuck canopy
#

Its working with a player but for some reason it doesn't work with a armorstand idk why

tight junco
#

how are you doing it

#

granted i don't know much about using velocity

stuck canopy
#

or maybe is it coz the entity has a passenger on it?

tight junco
#

but im pretty sure armourstand velocity has to be done differently

#

like #setVelocity(2.0) might not work because it doesn't have any

stuck canopy
#
                stand.setItemInHand(item);
                stand.setSilent(true);
                stand.setGravity(false);
                stand.setInvulnerable(true);
                stand.setCanMove(true);
                stand.setAI(true);
                stand.addPassenger(player);

                Rockets.add(stand);
                System.out.println(location);
                final int[] count = {0};
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        count[0] = count[0] + 1;
                        System.out.println("Worked");
                        if (count[0] <= 5) {
                            stand.setVelocity(stand.getVelocity().setY(stand.getVelocity().getY() + 2));
                            System.out.println("Worked");
                        }
                   }
                }```
lyric gyro
#

I believe disabling gravity on armour stands has that effect of simply not being able to move altogether

stuck canopy
#

but I have tried setting the gravity to true then setting the velocity and then setting the gravity back to false too

#

oh wait maybe it doesnt move coz I set the gravity to false right after setting its velocity

lyric gyro
#

What I'm trying to say is that it has to be always on for it to move

stuck canopy
#

aight let try it with gravity enabled

tight junco
#

yeah if it's gravity is disabled it won't work

stuck canopy
#

yea it works now, thanks

stuck canopy
#
                stand.setCanPickupItems(false);
                stand.setSilent(true);
                stand.setInvulnerable(true);
                stand.setCanMove(true);
                stand.setAI(true);
                stand.setArms(true);
                EulerAngle left = new EulerAngle(300f, 90f, 30f);
                EulerAngle right = new EulerAngle(60f, 90f, 330f);
                stand.setRightArmPose(right);
                stand.setLeftArmPose(left);
                stand.setItem(EquipmentSlot.OFF_HAND, item);
                stand.addPassenger(player);```
#

why does it not change its arm position

lyric gyro
#

u need to set position in serwver

#

by command

#

not in config

stuck canopy
#

huh?

#

its not a config

#

its a part of my code

dense drift
#

Use the consumer of the spawn method to edit the entity btw

#

D;world#spawn

uneven lanternBOT
#
@NotNull
T spawn(@NotNull Location location, @NotNull Class clazz, @Nullable Consumer function)
throws IllegalArgumentException```
Description:

Spawn an entity of a specific class at the given Location, with the supplied function run before the entity is added to the world.
Note that when the function is run, the entity will not be actually in the world. Any operation involving such as teleporting the entity is undefined until after this function returns.

Returns:

an instance of the spawned Entity

Parameters:

location - the Location to spawn the entity at
clazz - the class of the Entity to spawn
function - the function to be run before the entity is spawned.

Throws:

IllegalArgumentException - if either parameter is null or the Entity requested cannot be spawned

lyric gyro
sonic quartz
#

Why when I put setTransform before createPaste in worldedit api, createPaste methot cannot be resolved?

shell moon
#

prob because of what setTransform returns

forest jay
dusky harness
#

Uh

#

what is that?

grim oasis
#

I think it's resource pack related

dusky harness
#

ohhhhhhhh

grim oasis
#

it's a custom gui overlay

dusky harness
#

ic ic

#

i thought that was a map

#

lol

grim oasis
#

fooled you didn't they!

dusky harness
#

😖

forest jay
dusky harness
#

but yeah you can't open an inventory without "Inventory" I'm pretty sure

#

unless there's some resource pack magic

#

I have no experience with resource packs

#

as you can see

forest jay
#

yeah, but I was thinking that I could change the inventory view name or something, but I couldnt find anything on my own

grim oasis
#

I think you'd just have to remove the font for that text, but obviously it's gonna be removed everywhere then

#

I am not the genius when it comes to resource packs like others

forest jay
#

oh actually

stuck hearth
#

Text gets overlayed after, I imagine that would be the case.

forest jay
#

in the json file you can configure all of the messages

#

for different languages, I might be able to make it blank

grim oasis
#

I was just thinking about manipulating lang

#

idk if possible, but worth a shot

forest jay
#

yeah that works

#

but then it removes it from everywhere else

dusky harness
#
public static ItemStack applySkullTexture(ItemStack item, String url) {
    if (url.isEmpty()) {
        return item;
    }
    SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
    byte[] encodedData = Base64.getEncoder().encode(String.format("{textures:{SKIN:{url:\"%s\"}}}", url).getBytes());
    PlayerProfile profile = Bukkit.createProfile(UUID.randomUUID());
    profile.setProperty(new ProfileProperty("textures", new String(encodedData)));
    itemMeta.setPlayerProfile(profile);
    item.setItemMeta(itemMeta);
    return item;
}
```Anyone know why this would apparently show as the default player head?
#

Paper 1.18.2

hoary scarab
dusky harness
#

oh yeah I should cache it

#

wait

#

is it possible to cache it

#

doesn't the client make the web request?

#

since the client is the one displaying it

hoary scarab
#

I think it might now cause you can't use custom urls anymore

#

But besides that I usually cache the itemstack of the head instead of setting its profile everytime.

sonic quartz
#

Why my scheme doesn't get rotated? Must the angle in rotateY be in degrees, like 90 or what?
ClipboardHolder holder = new ClipboardHolder(clipboard);
AffineTransform transform = new AffineTransform();
transform.rotateY(angle);
holder.setTransform(holder.getTransform().combine(transform));
Operation operation = holder
.createPaste(editSession)
.ignoreAirBlocks(true)
.to(BlockVector3.at(loc.getX(),loc.getY(),loc.getZ()))
.build();
Operations.complete(operation);

lyric gyro
#

AffineTransform is immutable, rotateY returns a new transform with the rotation applied

sonic quartz
#

damn, thank you

dusky harness
#

Can you get a Chunk from its x and z? Or do you just have to multiply it by 16 and do World#getChunkAt

sterile hinge
#

World#getChunkAt?

dusky harness
#

oh

#

hm

#

nvm ignore my question 🥲

lyric gyro
#

lmao

icy shadow
#

delete the messages NOW

lyric gyro
#

yeah wtf

#

rare dkim

dusky harness
#

I only delete if no one replied

#

I don't want to make SirYwell look like he's talking to himself 😭

#

I wouldn't do that to him

lyric gyro
#

don't worry, he does that already

dusky harness
#

👀

icy shadow
#

bit of a double standard

dusky harness
#

Sorry brister mitten

#

:((

icy shadow
#

i do NOT forgive you

stuck hearth
#

Convert points to chunk or region data with bit shifting for speed

sterile hinge
#

I mean as long as it‘s a constant the jit will do that for you anyways

river solstice
#

Did anyone run into any issues using Reflections dependency?

wheat carbon
#

what issues are you facing?

river solstice
#

My issue is, that everytime the server restarts, the jar somehow grows in size and does not load at all.

wheat carbon
#

nice

#

what are you using reflections for?

river solstice
#

and I get this goofy ahh error

sterile hinge
#

What does "does not load at all" mean?

river solstice
river solstice
sterile hinge
#

Uh oh that doesn’t look good

dense drift
#

do you even need javaassist for that?

wheat carbon
#

org.reflections uses it

#

probs

dense drift
#

if classes come from your own jar

wheat carbon
#

javassist isn't just for other jars

river solstice
#

but I doubt it's a 'virus' or wtv

sterile hinge
#

The fact that it looks obfuscated is really sus

dense drift
wheat carbon
#

javassist is an instrumentation library, it's not directly tied to classpath scanning

river solstice
#

also, I'm using implementation, should it be a compileOnly?

sterile hinge
#

So yeah, that malware thing might be reasonable

river solstice
#

I assume it wont work at all if I dont add it with shadowjar

wheat carbon
#

m0dii, build your jar, then run it on a fresh server with no other plugins

#

clean and build

river solstice
#

uno momento

#

might not be able to do that since it has a soft dependency

wheat carbon
#

yeah include any dependencies

#

redownload them from spigot though

#

don't copy anything from the existing server

river solstice
#

well, in a clean environment it seems like everythings as it should be after restarting

wheat carbon
#

ok two possibilities that I can think of

#

malware, like others suggested

#

or runtime classpath conflicts

#

i.e. two or more plugins, both with javassist, fucking around

mellow pond
#

cant u just check if its the latter by downloading everything clean

#

from spigot

river solstice
#

surely

mellow pond
#

well if its malware u have to do it anyways?

river solstice
#

why is it one specific plugin tho then

#

wouldnt it be any

sterile hinge
#

There’s a class f with a method b, maybe you can find it in some jar file

#

Or well, javassist/f

mellow pond
#

no only plugins using javaassist i would have thought?

mellow pond
wheat carbon
#

@sterile hinge is there any guarantee those classes exist outside of runtime

sterile hinge
#

No, but the naming doesn’t sound like it’s something official tbh

river solstice
#

I assume the other idea would be to not use reflections at all, but I don't really wanna register 60 different classes by hand 💀

sterile hinge
wheat carbon
#

it's pretty easy to do what reflections does, without doing what reflections does behind the scenes

#

just scans the jar instead of the classpath, works just as well though for this purpose

river solstice
#

that's what I'm using it for

wheat carbon
#

yeah I'm saying it's easy to do that, without using reflections

sterile hinge
#

Just create one class with a custom annotation processor fingerguns

mellow pond
#

Who let a pig be a developer O.o

river solstice
#

its that simple that a pig can do it

mellow pond
wheat carbon
#

it's not strictly the same

#

like the implementation is completely different, couldn't be more different

#

but to the end user, there's not gonna be any difference

tight junco
#

yes GIGACHAD

river solstice
#

so, is it possible for the class to process itself (register as enchant, as a listener or wtv) with annotation processing?

#

I would just be using that instead of Reflections, since I'm already using annotations as it is

wraith scarab
#

Hi im trying to rerun buildtools to use nms i want to download the 1.8.8 version but when i execute the buildtools i get this error

Starting download of https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1914)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1512)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
        at java.net.URL.openStream(URL.java:1092)
        at com.google.common.io.Resources$UrlByteSource.openStream(Resources.java:72)
        at com.google.common.io.ByteSource.read(ByteSource.java:296)
        at com.google.common.io.Resources.toByteArray(Resources.java:98)
        at org.spigotmc.builder.Builder.download(Builder.java:1083)
        at org.spigotmc.builder.Builder.main(Builder.java:416)
        at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)

here is the command i execute
"C:\Program Files\Java\jre1.8.0_351\bin\java.exe" -jar BuildTools.jar --rev 1.8.8
and i'm using git bash

sterile hinge
tired olive
#

you could just write an ap to create META-INF/services/ files and register them that way

lyric gyro
#

ServiceLoader my beloved

tired olive
#

sadly its not used enough with by mc devs

sterile hinge
#

because it doesn't work well with the classloader mess from my experience

tired olive
#

thats just classloader stuff

#

just put the classloader in the overloaded ServiceLoader.load(Class<?>, ClassLoader) method

sterile hinge
#

that only works if you're controlling it that much

tired olive
#

wdym

sterile hinge
#

when using a library that uses the ServiceLoader api, you can't controll how that library loads services

tired olive
#

most of the time u can, otherwise just make a pr

#

and for this thing, its very specific and simple so u would probably just make it urself

lyric gyro
#

Not always a feasible thing

#

Bukkit's class loading is simply shit and a clusterfuck and broken

#

esp when using the library loader

river solstice
river solstice
river solstice
lyric gyro
#

the fuck you mean "most of them use javassist?

#

what kind of plugins do you use

#

if you just happened to find javassist inside their jar files, it most likely is that malware thing

lyric gyro
river solstice
#

nvm i has 17

#

sheeesh

#

💀

sterile hinge
#

welp

lyric gyro
river solstice
#

wtf is ChestGIveaway

#

AntiCrash/CrispyBow

lyric gyro
#

idk

river solstice
#

so is this like one plugin that is spreading to everything else or more of a x infects y, y infects z, etc. or no real way to tell?

lyric gyro
#

yeah it's the latter

mellow pond
#

its basically a trojan horse

hoary scarab
#

Someone used a leaked plugin lol

river solstice
#

that would explain it, where it came from

#

owell, at least now I have some mess to fix from previous dev

proud pebble
#

its modified every plugin? interesting

lyric gyro
#

yes it does that

#

even the relevant server jars + libraries afaik

hoary scarab
#

I think paper released something to check your jars and then blamed spigot saying users accounts got hacked.

lyric gyro
#

I can confirm that definitely did not happen

dense drift
#

Most of these come from leaked plugins

worn jasper
#

Would this work to do a permission based level system? (in other words, any better alternatives?)

public int getLevel() {
  var player = Bukkit.getPlayer(userId);
  if (player == null) return 1;
  for (var perm : player.getEffectivePermissions()) {
    var permString = perm.getPermission();
    if (permString.startsWith("plugin.level.")) {
      var splitPerm = permString.split("\\.");
      var level = Integer.parseInt(splitPerm[2]);
      return level;
    }
  }
  return 1;
}
dense drift
#

Depend on luckperms and use meta 😊

lyric gyro
#

trueeee

worn jasper
hoary scarab
worn jasper
#

never used that

mellow pond
#

use luckperms api (i think they are asking)

dense drift
#

Lp meta is just perfect

#

But if you really want to use perms, it might have a better api for filtering idk

worn jasper
#

(if that makes sense)

dense drift
#

Is not spigot's fault directly that accounts got hacked

worn jasper
mellow pond
#

and 1 acc that got compromised or smth

dense drift
#

is just getMeta("key") and then parseInt

worn jasper
dense drift
#

And you can configure lp to give you the highest/lowest value

worn jasper
hoary scarab
#

Idk only place I've see compromised plugins is leaks. Not the actual authors account on spigot.

dense drift
#

You get the user, access its data then go to meta bla bla

#

Lp api seems complexe at first but it is hella powerful

hoary scarab
#

Isn't someone working on PermissionsEx 3.0?

dense drift
#

Go away dude

#

Like, literally

worn jasper
#

sooo let me see,

User user = luckPerms.getUserManager().getUser(uuid);

to get the user, using the uuid, now gotta find the other part lol

#

user.getCachedData().getMetaData().getMetaValue("some-key"); ?

#

would this in this case return whatever is behind some-key? aka some-key.*3*? I am so confused rn lol

dense drift
#

Yes

#

yes

worn jasper
#

oh okay, that's cooolll I guess

dense drift
#

add an Ints::tryParse there

worn jasper
#

where?

dense drift
#

getMetaValue takes a function as second param

river solstice
#

alright, well, I redownloaded all the plugins and I still get this

worn jasper
dense drift
#

Have you also installed a new server jar and delete all folders where libraries can be?

river solstice
#

yeh

worn jasper
#

pretty sure paper recommended reinstalling the whole server

#

xD

#

not just plugins and whatever

#

in some cases, depending on if you are using a host, or a dedicated machine, might have to reinstall that too lol

#

depends a lot on where the virus got into

dense drift
#

I guess if you use perms right and ptero, it shouldn't be able to exit the server container

worn jasper
#

that's an IF

#

but ye, most of the cases just a fresh reinstall of the server.

#

put new jars.

#

Slowly, preferably.

#

Maybe one of the fresh installed jars can be infected? (which in that case you will know from where it's coming from)

#

(if it's actually spigot accounts being hacked like it was stated)

dense drift
#

The size of the jar should be noticeable bigger from my experience, like additional mb

river solstice
#
[17:29:52] [DETECTED]: plugins/OreAnnouncer-2.8.3.jar MIGHT be infected with Spigot.INFO.Non-Vanilla Enchantment.A Class Path: com/alessiodp/oreannouncer/core/bukkit/utils/ItemBuilder ; SourceFile/Line ItemBuilder.java/79

Wouldnt this be safe to ignore?

worn jasper
#

wth?

#

the virus spreads from one jar to the rest.

#

so having ONE jar infected is already enough to infect everything else.

river solstice
#

well, I mean, from the Spigot.INFO.Non-Vanilla Enchantment

dense drift
#

Look at that class and see whats going on

#

oreannouncer is os iirc

worn jasper
#

A node in luckperms is a permission right?

high edge
#

Yes

marble nimbus
#

Hey I am trying to replace a ${version} placeholder inside a .java file during gradle build. But I am not too sure how to achieve this. processResources is like the name says only for the src/main/resources folder

river solstice
mellow pond
#

Some plugins do have a falseflag

#

(citizen has a forceop falseflag) iirc bcs it has the option to run a command as console when u right click a npc

tight junco
#

if thats not what you want then

#

L i guess

marble nimbus
#

** inside a .java file** is the key part here, I know how to do it for resources, but I need to replace it, inside a Java file

tight junco
#

Is this inside a plugin, you never defined because the resources package is in every java project

marble nimbus
#

no not inside a Plugin.

#

but I want to replace something inside a .java file so it doesn't matter if its a plugin or not

tight junco
#

well yes because this is crazily enough, a plugin support server so it's helpful to know what you're working with 🤠

So from what i can see, you'll just want a file in resources to be have the version in the file and read that file and replace whatever you're trying to replace with that value

lyric gyro
#

anyone familiar with ACF by aikar and able to help me with making a Help System for my entire plugin under 1 Help Command With Sub Hlep Commands

#

or just 1 idm

icy shadow
#

whats the problem & what have u got so far

lyric gyro
#

So for some reason I cant seem to do any of the help it only does it per command when I want it too have a global command for that plugin help then add the commands too that map

lyric gyro
#

but atm i only have it per command registered

lyric gyro
#

i can upload too gitlabfor ya

dusky harness
#

Github > gitlab

lyric gyro
#

I use gitlab so I can make project private when I need to it’s just my preference

sterile hinge
#

isn't that possible on gh without premium for a while now?

dense drift
#

it is

lyric gyro
#

Is it ?? I’ll have too look into that as I’d prefer GitHub tbh

dusky harness
#

Jeez

#

cmon github

#

well I can tell you for sure that it's not behind a paywall anymore

sterile hinge
#

yeah like 5 years ago or something like that

jade wave
#

Its not and otherwise just get github student

#

Easy fix

#

Gives you github pilot aswell

#

*copilot

dusky harness
#

and all jetbrains tools

#

All for free 😌

#

I don't use most of them but I have it anyways 🥲

lyric gyro
#

anyone know how per module is a separate GitHub project ?

lyric gyro
#

Anyone know how i can add commands too ACF Help Command manually ?

lyric gyro
#

So with this class when in game for some reason i have to do /gma gma

#

instead of just /gma

#

i use ACF btw

shell moon
#

on server stop, when are players kicked?

proud pebble
#

before plugin disable afaik

shell moon
#

my plugin saves on player leave (async, using a task)

dusky harness
#

I don't think player leave is called

shell moon
#

but when server stops, players are kicked

dusky harness
shell moon
#

so how would i do it?

dusky harness
#

since in onDisable you can see

proud pebble
#

then you save on disable

#

you cant do it async on server quit

dusky harness
#

in onDisable you don't have to do async

broken elbow
#

players are kicked after plugins are disabled on spigot. I can confirm that.

#

if you want to save player data or stuff like that, just have a foreach loop in your disable and save it there.

shell moon
#

you sure player quit/kick event is not called then

mellow pond
#

Heya Luna!

shell moon
broken elbow
#

well even if it is called you can't get it

#

so it doesn't even matter

mellow pond
#

Should i learn to code plugins

#

well plugins/java

shell moon
#

nice! i'll take a look then

broken elbow
#

but yes. learn at least the basics of java before getting into plugins

neat pierBOT
#
FAQ Answer:

Online Courses:
Online courses are also great for learning java. Some websites that offer them are:

  • Coursera - Free unless you want a certificate
  • PluralSight - Great courses from what I've seen. Mostly Paid
  • Udemy - Never used them myself but they seem to all or at least most be paid.
    My first ever course was one from Coursera. - I can say it was pretty good at introducing me to the programming world as a whole not just java.

Oracle Docs:
Oracle docs can help a lot at learning and understanding java:

  • Start with this,
  • Breeze through this (skipping stuff that doesn't seem relevant like bitwise operators),
  • Hit this.
    They're the first three from this larger thing which you should definitely go through overall. But those three should be enough for slightly better understanding of what is happening here without feeling like a huge time sink.
    That one is a small part of this larger site wherein "Essential Java Classes" and "Collections" also have good useful stuff

Other services:
Some other cool services that will help you learn java are:

As you can see there are plenty of good ways to learn as long as you're willing to invest the time. Have fun learning!

shell moon
#

Free unless you want a certificate

#

online certifiate? is it valid? (just wondering)

broken elbow
#

if people want to consider it or not

shell moon
broken elbow
#

I'm sure it will help with a CV however.

#

where I work, people are getting certificates for all kinds of stuff because clients like to see that and are even willing to pay more for it.

shell moon
#

i'll have to find a place to study then xd

broken elbow
#

I mean it isn't a guarantee. Here, they specifically asked for it. Not all places take all certificates with the same seriousity.

#

But as I've mentioned, I'm sure it will help with your CV. Even if it won't get you a job, it will at least attract their attention

shell moon
#

yeah, i mean to find a place to study (irl) idk the word ("in person"? xdd)

lyric gyro
forest jay
#

Is there a way I can use the CustomModelid system for entities?

worn jasper
#

Like, I am pretty sure I have the perm plugin.level.1 but getting the metavalue of plugin.level isn't returning anything

dense drift
#

meta is set with /lp user [user] meta set [key] [value]

worn jasper
#

oh...

lucid mica
#

How do i check if an item with itemmeta is right clicked?

tight junco
#

if you're using InventoryClickEvent

#

d;spigot InventoryClickEvent#getClick

uneven lanternBOT
#
@NotNull
public ClickType getClick()```
Description:

Gets the ClickType for this event.

This is insulated against changes to the inventory by other plugins.

Returns:

the type of inventory click

tight junco
#

if click type is right click, get item meta, check if meta is null, continue on with whatever

lucid mica
tight junco
#

is this in a gui or the hand

dense drift
#

click by holding it? PlayerInteractEvent

lucid mica
dense drift
#

d;playerinteractevent#getitem

uneven lanternBOT
tight junco
#

welp that would of been helpful

lucid mica
tight junco
#

d;spigot PlayerInteractEvent#getAction

uneven lanternBOT
tight junco
#

check if they right click air

#

or right a block

stuck canopy
#

is there a easy way to format numbers like for example 5130 to 5.1k

dense drift
#

Use google and a stackoverflow post will come up

stuck hearth
hoary scarab
tight junco
#

or get copilot and get that to do it for you

hoary scarab
#
public String formatMoney(final double amount) {
    if (amount < 1000.0)
        return this.format(amount);
    if (amount < 1000000.0)
        return String.valueOf(this.format(amount / 1000.0)) + "k";
    if (amount < 1.0E9)
        return String.valueOf(this.format(amount / 1000000.0)) + "m";
    if (amount < 1.0E12)
        return String.valueOf(this.format(amount / 1.0E9)) + "b";
    if (amount < 1.0E15)
        return String.valueOf(this.format(amount / 1.0E12)) + "t";
    if (amount < 1.0E18)
        return String.valueOf(this.format(amount / 1.0E15)) + "q";
    return String.valueOf((long)amount);
}

private String format(final double number) {
    final NumberFormat format = NumberFormat.getInstance(Locale.ENGLISH);
    format.setMaximumFractionDigits(2);
    format.setMinimumFractionDigits(0);
    return format.format(number);
}
```Old code same idea
tight junco
#

wow

#

that looks terrible

lyric gyro
#

CompactNumberFormatter moment

hoary scarab
#

Np

dense drift
lyric gyro
#

You calling me a liar?

dense drift
#

Damn

#

d;jdk CompactNumberFormatter

uneven lanternBOT
#
public final class CompactNumberFormat
extends NumberFormat```
CompactNumberFormat has 1 extensions, 2 all implementations, and  21 methods.
Description:

CompactNumberFormat is a concrete subclass of NumberFormat that formats a decimal number in its compact form. The compact number formatting is designed for the environment where the space is limited, and the formatted string can be displayed in that limited space. It is defined by LDML's specification for Compact Number Formats. A compact number formatting refers to the representation of a number in a shorter form, based on the patterns provided for a given locale.

For example:
In the US locale, 1000 can be formatted as "1K", and 1000000 as "1M", depending upon the style used.
In the "hi_IN" locale, 1000 can be formatted as "1 हज़ार", and 50000000 as "5 क.", depending upon the style used.

To obtain a CompactNumberFormat for a locale, use one of the factory...

This description has been shortened as it was too long.

Since:

12

dense drift
#

Interesting how it is also localized, I want to see what lame ass format romanian has

lyric gyro
#

lol

dense drift
lyric gyro
tight junco
#

You need to send a message to the console command sender

#

d;spigot ConsoleCommandSender

uneven lanternBOT
#
public interface ConsoleCommandSender
extends CommandSender, Conversable```
ConsoleCommandSender has 2 extensions, and  4 super interfaces.
lyric gyro
#

okay

tight junco
#

Bukkit#getConsoleSender()

#

and you just use the typical chatcolor stuff

stuck canopy
#

how can I create a Sign GUI to get a player's input

dense drift
#

If you are using paper, you can probably use this

#

d;paper HumanEntity#openSign

uneven lanternBOT
#
void openSign(@NotNull Sign sign)```
Description:

Opens an editor window for the specified sign

Parameters:

sign - The sign to open

weak monolith
#

all

#

guys, please tell me how to use Cyrillic and unicode characters in minimessage

#

please

sterile hinge
#

what's the problem?

#

oh well you're crossposting...

stuck canopy
grand zodiac
#

NMS makes me want to kill myself 💀

#

this is painful

#

what sort of sick shit have i done in a past life to deserve this 😭

high edge
#

Just don't use NMS, ez

grand zodiac
#

Don't really have a choice for some things

hoary scarab
#

If you're using latest, you can use the unmapped jar and remap it with the maven plugin

dusky harness
#

or paperweight with gradle 😎

#

or if you're not using 1.14+ then screamingsandals gradle plugin

tight junco
#

you really do have to check every method possible that means you don't need NMS

dusky harness
# hoary scarab ??

I'm not entirely sure what he means but I'm assuming that he means that you should check everything in the spigot api to make sure you need NMS

hoary scarab
#

Well IDK about the other user but NMS is a must have for me lol
NBTTags, ChunkData/block manipulation etc...

dusky harness
#

NBTTags - NBTAPI
idk what you mean by chunk data and block manipulation

tight junco
#

I mean like, can this be done in spigot api in any way, can it be done in paper api in any way

#

just trying to keep nms usage in the plugin low shrug

hoary scarab
dusky harness
#

you can shade it though

#

and you don't need to mess with NMS

hoary scarab
#

No point when I have my own xD

hoary scarab
dusky harness
#

Not for NBTAPI

#

NBTAPI does the nms for me

#

so I rarely have to use NMS

hoary scarab
#

Ok but it still requires NMS lmfao

dusky harness
#

instead the developer of NBTAPI does

hoary scarab
#

The conversation is what is required

dusky harness
#

also, NBTAPI handles multiple versions for you whereas with spigot remapping for example, it's not as simple

hoary scarab
dusky harness
tight junco
#

yeah you're completely missing the point of the conversation

hoary scarab
#

^^

tight junco
#

no im talking to you

#

dont agree with me

#

no one enjoys writing in NMS so trying to keep as much direct nms usage out of a plugin is usually goal

hoary scarab
#

The convo is NMS is used no matter using that API or not. NMS is still used.

dusky harness
dusky harness
hoary scarab
#

Not if NMS is required for what that user was doing.

tight junco
#

No one said NMS is not required

#

as always pulling random stuff out of thin air, grasping at straws

#

the same point both me and dkim made was its better to try and use different APIs in plugins instead of directly importing NMS into the project

hoary scarab
dusky harness
hoary scarab
dusky harness
#

????????????

tight junco
#

They probably meant they dont need to import NMS because they have NBTAPI to do it for them

dusky harness
#

If you think about it, spigot and paper api uses NMS too

tight junco
#

I was just making the point that its best to make sure you don't need to import NMS in whatever way and its best to check if you can do stuff otherwise

dusky harness
dusky harness
hoary scarab
#

Yes we moved passed what you were saying and moved to dkim saying NMS isn't required if he used an API

They probably meant they dont need to import NMS because they have NBTAPI to do it for them
He could have meant this but didn't confirm he did. So based on his message I continued the convo

dusky harness
#

Didn't I confirm?

dusky harness
#

NMS does all the work for me

#

and

tight junco
#

i dont even think my first sentence was that confusing

dusky harness
#

but I hope he recognizes it now

hoary scarab
#

Spigot and plugins that require support are usually the only API's I used. I generally make my own if I need it cause i don't like other's code and don't like dealing with others (Updates, support etc...).

tight junco
#

And you can have that superiority complex i guess

dusky harness
#

🥲

#

I'd say NBTAPI is updated pretty well

#

and I've previously forked a library to update it myself instead of recreating it

#

only NMS libraries that I use frequently afaik are TriumphGUI (matt 😍) and NBTAPI

hoary scarab
dusky harness
tight junco
#

yapps is the type of person to do that

#

yeah knew it

dusky harness
#

Oh my

#

lol

tight junco
#

anyway this isnt really a difficult concept to grasp but sure

#

paint supremacy honestly

hoary scarab
tight junco
#

there should of really been an extra question of

#

"do you really have to add this feature" but i got impatient

dusky harness
#

I had some hope

#

but now

#

im just gonna watch some youtube

#

and let Ori say the rest

tight junco
#

yeah im done anyway

dusky harness
#

theres this other guy who wanted to wanted to make a minimum TPS before iirc and etc etc (or something to mess with TPS I don't remember)

#

was a long time ago

#

i forget his username now

tight junco
#

Server#setTPS(Math.max(15, Server.getTPS())

dusky harness
#

Aw cmon his discord acc is deleted so I can't even check his old messages

#

unfortunate

hoary scarab
#

Oh misread lol

dusky harness
#

even though Copy ID works

hoary scarab
#

Search sometimes doesn't work for me so IDK

lyric gyro
#

the ID copied from deleted users is the all same

slow swallow
#

hi guys so im making gui for item repair and size of that gui is 54 so there is 54 slots and on slot 22 i left air every other slot is glass and i want to make able for players to put any item they want to repair into that gui and when they add that item gui changes and adds red and yellow wool
i know how to make eveything except to get item player has moved to gui
any sort of help about that like which event should i use and how

#

trying to get this

hoary scarab
lyric gyro
#

It is

#

Search messages in different servers from deleted accounts and copy the user ID

#

They will all be the same

#

copied one random from this server (456226577798135808) and from another random emotes server (456226577798135808) and another one from luckperms (456226577798135808), all of them are the same which is also the same dkim got

lyric gyro
#

💀 i forgot about that dude lmao

leaden sinew
#

Lol

#

Was their name Vision?

#

Or was that somebody else?

lyric gyro
#

yeah vision

leaden sinew
#

They had some great ideas

lyric gyro
#

way ahead of his time

#

brilliant mind

hoary scarab
#

I just copied multiple different id's from delete accounts

lyric gyro
#

cool

#

now compare them

lyric gyro
hoary scarab
#

All different

#

One sec

#

547185700437753856

lyric gyro
#

brother

#

that is not a deleted account

#

lmao

#

it'd have #0000

hoary scarab
#

395294992374956033

tight junco
#

they are not deleted accounts

#

my guy is contradicting to contradict

lyric gyro
#

💀

hoary scarab
#

Show me some "Deleted accounts" then?

lyric gyro
tight junco
#

actually

lyric gyro
tight junco
#

it might be a two things at once could be true

#

they could be older accoutns so they're delted in a different way

lyric gyro
#

nah the one in luckperms is from 2016 and it's the same

hoary scarab
#

No clue both are deleted accounts

stuck canopy
dense drift
#

You can probably create a sign without setting it in the world, uh?

neat pierBOT
#
FAQ Answer:
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait

Source

lyric gyro
#

ive hit a hole when trying todo a single command with ACF it doesnt work how can i make it so when i do /gmc it change my Gamemode using ACF Framework

icy shadow
#

@Default

plain oak
#

h

torn heart
#

this do be more of a math question but anyone know any code/plugin that already does this. basically just to check if two rectangular prisms overlap. i can't use basic < than check cause they mightb e rotated as well

leaden sinew
lyric gyro
stuck hearth
#

skill issue

lyric gyro
#

ima just recode the cllass i think ive found the issue

dusky harness
#

Is there a way to kill a player and set their spawn without listening to respawn event?

#

or do I have to make like a map

leaden sinew
#

You could just attach a temporary PDC to them

#

Why don't you want to listen to the respawn event?

dusky harness
#

although when they die would it stay onto them?

dusky harness
#

and then like a join/leave listener

#

etc

leaden sinew
dusky harness
#

Alr, ty fish

#

👍

leaden sinew
#

No problem

#

And if it doesn't, that means I've probably messed up some past plugins lol

dusky harness
#

💀

leaden sinew
#

I have to stop talking here before I go to tier IV

#

I want to keep this color

forest jay
#

I am trying to remove a single item from an inventory, and give a percentage of the buy price depending on its durability. Currently, it comes with an error saying that ItemMeta cannot cast to Damageable ```java
for (ItemStack item : player.getInventory().getContents()) {
if (item == null) {
continue;
}

if (item.getType() != keys.get((finalX * 6) + finalY)) {
continue;
}

Damageable meta = (Damageable) item.getItemMeta();
conquest.get().addGold((int) (weapons.get(keys.get((finalX6) + finalY))(meta.getHealth()/meta.getMaxHealth())));
item.setAmount(item.getAmount() - 1);
break;
}

lyric gyro
#

what's the exact full error?

hoary scarab
#

not all items are damageable

forest jay
#

it is a piece of armor

#

the error wont paste

lyric gyro
#

stupidly enough, every itemmeta implements damageable

forest jay
#

it keeps giving an error

forest jay
lyric gyro
forest jay
lyric gyro
#

entity.Damageable

forest jay
#

oh

lyric gyro
#

Wrong Damageable import

forest jay
#

it is it the wrong class

#

yeah

#

wait so, how do I get the items max durability?

dense drift
#

d;org.bukkit.inventory.meta.damageable

uneven lanternBOT
#
public interface Damageable
extends ItemMeta```
Damageable has 1 extensions, 4 super interfaces, and  4 methods.
Description:

Represents an item that has durability and can take damage.

lyric gyro
#

I think the max is in the Material

dense drift
#

yea

#

damageable only give you the damage, which you need to subtract from material#getMaxDurability to find out the remaining 'health' of the item

hoary scarab
#

Yeah IDK why they start durability at 0 🤦

dense drift
#

the damage starts at 0, not the durability 🙂

worn jasper
#

uhm I have heard ProtocolLib is quite bad in terms of performance, is that true?

worn jasper
#

hmm

dusky harness
#

I'm pretty sure it's very performant

lyric gyro
#

v5 has been reworked entirely and it isn't as shitty anymore

worn jasper
#

hmm okay

#

now just gotta findout if I should use velocity or waterfall lmao

lyric gyro
#

Velocity

worn jasper
#

(I mean, I kinda know why but just making sure lol)

#

besides that, TAB doesn't support velocity which sucks lmao

lyric gyro
#

I mean I could list the reasons but you're gonna hear what you already know

#

Bungee is effectively in maintenance mode, Velocity is more stable, yada yada

jade wave
#

Honestly I'd go with waterfall

#

But that's mostly because I have been working with it for ages

#

What I have noticed though, is that alot of plugins don't support velocity, which can suck sometimes, but velocity does make up for it in performance and speed.

Id say the main factor on what to choose is depending on how big the network is-

tired olive
#

the api is also much better

#

waterfall api gives me paper api vibes

stuck hearth
#

You don't say?

dusty frost
#

velocity was literally made by the waterfall dev

#

intended to be a complete rewrite of the shitty bungeecord api

tired olive
#

velocity doesnt

stuck hearth
#

I didn't ask

tired olive
#

💀

worn jasper
#

might have to use waterfall 😭

#

several plugins I will use don't support velocity

#

wait can I like, use velocity for performance and then connect players to a waterfall proxy to benefit from comptability? Aka the velocity proxy handles all the stress and the waterfall just exists lol

#

would waterfall be also under stress?

lyric gyro
#

that is not how it works

#

if the player connects to the waterfall proxy, the proxy used is waterfall

#

if they don't connect to velocity, velocity is not used

stuck hearth
#

Early morning Emi

pulsar ferry
#

Best Emi

worn jasper
#

velocity would handle the first connection

#

which is usually where the issues are I assume

lyric gyro
#

if what you have in mind is client <-> velocity <-> waterfall <-> servers

#

that's a horrible idea

#

the actual proxying action would be controlled by waterfall anyway

worn jasper
#

oof regarding performance, how performant is velocity compared to waterfall?

#

really gotta choose one oof

dusty frost
#

it's a lot better

#

what kind of plugins are you missing?

#

i managed to find equivalent or improved versions for all the stuff i needed

mellow pond
#
  • some bungeecord plugins are just builtin features of velocity
#

like bungeeguard, fallback server etc

hoary scarab
#

... bungeecord has fallback server last time I checked.

mellow pond
#

velocity sends u to hub if backend server ur on gets shutdown

#

might be different now as the post was 2 years old

stuck hearth
#

Probably not

worn jasper
worn jasper
lyric gyro
#

better in what aspect?

#

also never heard of it so 🥴

stuck hearth
#

It uses base64 to ensure encryption all the way through

worn jasper
#

its basically a merge of ipwhitelist and bungeeguard

lyric gyro
#

but velocity's "native bungeeguard integration" isn't quite like that either, it's the same principle but different

worn jasper
#

I think

stuck hearth
#

Hopefully nothing

mellow pond
worn jasper
#

also safenet also supports geyser which is also cool

mellow pond
#

huh

stuck hearth
worn jasper
mellow pond
worn jasper
#

I mean, idk it myself, I just heard safenet was better

mellow pond
#

bungeeguard is a server only thing

worn jasper
#

never did the research

mellow pond
#

protects ur server from bungeecord exploits

lyric gyro
#

I mean ideally you wouldn't need either of those solutions

stuck hearth
#

I bet velocity doesn't protect against Bungeecord exploits

lyric gyro
#

And get a real firewall instead

mellow pond
#

LMFAO

stuck hearth
#

You got the joke, grats

mellow pond
#

yes

#

@worn jasper to use velocity at all, they make u use a secure forwarding secret (generated by it) and put on all backends uw ant to use

lyric gyro
#

That is not true

mellow pond
#

but also has legacy bungeecord and bungeeguard support

lyric gyro
#

You can use velocity without using the forwarding stuff

mellow pond
#

true

#

but

#

no

lyric gyro
#

wdym no lmao

#

It will work just fine

mellow pond
#

atleast u dont have to install a plugin to use it

mellow pond
#

mb for miswording it

stuck hearth
#

dusty frost
#

very solid for me

lyric gyro
#

But then again, ideally you'd use a properly configured firewall instead, these solutions are useful only when you can't get your hands on one such as shared hosting

mellow pond
lyric gyro
#

Oh I know

worn jasper
dusty frost
mellow pond
dusty frost
#

or you can share it on multiple and it doesn't resend when you do server swap

mellow pond
#

Ah

#

thats handy

dusty frost
#

the good part is the no resend

#

cause we have a global resource pack per

#

and you don't need to restart the servers to apply a new one

worn jasper
dusty frost
#

not anymore

#

i modified it to get it to work

stuck hearth
#

cheater 😮

mellow pond
#

ive never tried Snap but snap might work?

#

for TAB

lyric gyro
#

No it doesn't

#

It's all an illusion

worn jasper
shy canopy
#
    public void startRandomEvents() {
        LavaRising lavaRising = new LavaRising(main);

        new BukkitRunnable()
        {
            public void run()
            {
                if (lavaRising.getGameInProgress())
                {
                    RandomEvent randomEvent = new RandomEvent(main);
                    randomEvent.randomEvent();
                } else
                {
                    Bukkit.broadcastMessage("Debug stop");
                    this.cancel();
                }
            }
        }.runTaskTimer(main, 0, 10*20L);

How i can make this instantly stop loop when gameInProgress is false?

Or is this totally wrong channel for develoment questions?

lyric gyro
#

yeah just call cancel

stuck hearth
#

Easiest question ever

shy canopy
#

I mean it doesn't instatly stop... It's stop that when it call that again....

stuck hearth
#

Are you asking how you would stop the task when the game ends?

shy canopy
#

yeah

stuck canopy
#

        Location location = player.getLocation();
        location.setY(255);

        assert XMaterial.OAK_SIGN.parseMaterial() != null;
        player.getWorld().getBlockAt(location).setType(XMaterial.OAK_SIGN.parseMaterial());
        Sign sign = (Sign) player.getWorld().getBlockAt(location).getState();
        sign.setEditable(true);
        sign.setLine(1, "^^^^^^^^^^^^^^^");
        sign.setLine(2, "Enter the amount");
        if (type.equals(TransactionType.DEPOSIT)) {
            sign.setLine(3, "to deposit");
        } else {
            sign.setLine(3, "to withdraw");
        }
        sign.update(true);
        player.openSign(sign);
        Signs.put(sign.getLocation(), type);

    }```
Why does this sign doesn't update
It opens a empty sign for the player
worn jasper
#

uhm so regarding a clan plugin, if I store it per clan file, I would either have to:
A - On player join, loop through all clans, check if that player is in that clan, if yes, then cache that player's clan (so that the plugin knows that user's clan)
B - Have a storage, that already contains this data and just loads it. I think it would be fine with just one file probably.

Which would be the best?

leaden sinew
warm steppe
#

Keep clans in memory and just loop through then when needed

#

And save to a mysql when needed

worn jasper
#

¯_(ツ)_/¯

worn jasper
#

hence why I am asking lul

hoary scarab
#

Could just store clan ID/name to players PDC

warm steppe
#

No

#

💀💀

lyric gyro
#

yes

#

I mean that's totally reasonable tbf

leaden sinew
#

Yeah that’s what I would do, although I’m not sure why you’re being asked to use JSON for this

worn jasper
#

me neither

#

I asked & recommended a db

#

they said json

#

I mean, their choice lmao

worn jasper
#

idk why

leaden sinew
#

I mean if they’re going to force you to use a bad storage option, it’s their fault when the performance is bad

dusty frost
#

bro's going mongo?

#

or like flatfile json

#

cause mongo could be sick

icy shadow
#

MongoDatabase

dusty frost
#

like "bro's going ape shit"

#

but mongo yk

worn jasper
#

idk

#

I myself, am working with json itself.

#

idk what he wants afterwards lol

#

hell I don't even know how much to charge him for it lol

#

thoughts?

dusky harness
#

Which would result in the same performance

dusky harness
dusky harness
worn jasper
#

I am just brainstorming lol

leaden sinew
dusky harness
#

That should be running asynchronously

dusky harness
leaden sinew
dusky harness
#

Why do you have thousands of data files

leaden sinew
#

Exactly

dusky harness
#

Idk if that's better practice since if one gets corrupted the rest is still there

But thousands is a lot

leaden sinew
#

I know

dusky harness
#

I usually just do 1 bc I'm lazy 🥲

leaden sinew
#

That’s still not great either

dusky harness
#

Databases are good bc it can be accessed safely from multiple places and won't corrupt easily

#

And ig for huge amounts of data database is better, ex it probably won't go well if discord stores all its data in json files

leaden sinew
#

Yeah this is not a great use case for JSON storage in my opinion

worn jasper
#

what can I say ¯_(ツ)_/¯

queen plank
#
@CommandInfo(command = "conversation", label = "score")
public final class ConversationCommand extends AbstractCommand {
    public static final String COMMAND = ConversationCommand.class.getAnnotation(CommandInfo.class).command()
            .toLowerCase();
}

This code gives me the error Caused by: java.lang.NullPointerException: Cannot invoke "com.sniskus.score.commands.CommandInfo.command()" because the return value of "java.lang.Class.getAnnotation(java.lang.Class)" is null. How?

#

Java is broken :<

queen plank
#

Calling what?

#

I'm doing ConversationCommand.COMMAND from another class if that is what you mean

leaden sinew
#

Oh sorry I missed you were doing it in the same class

queen plank
#

Ah

#

I'm dumb

#

I forgot @Retention(RetentionPolicy.RUNTIME)

leaden sinew
#

Oh yeah that would do it lol, I was just going back to check a project I used annotations for

queen plank
#

🧠

worn jasper
#

Any ideas what the issue could be here: https://spark.lucko.me/o1bXlU8Xv0
PS: Not mine, it's from a friend.
PS2: Yes, skript is there, don't question me, I already told him to ditch it
PS3: Yes, I already tried understanding what's wrong but can't figure it out.
PS4: Is ProtocolLib supposed to be that high in usage? Though it was an optimized plugin lol

spark is a performance profiler for Minecraft clients, servers, and proxies.

tight junco
#

i dont actually think this is the right channel but

#

when was this profile taken because that doesn't look that bad

#

because when you go through the laggy stuff, i can see its just a lot of ItemStack stuff

sterile hinge
#

yeah looks like there is some bad ItemStack

tight junco
#

and when looking at it in the plugins list whatever lag there is

#

is mostly just packets

#

which'll be why protocol lib looks like its doing a ton

mellow pond
hoary scarab
#

Spark shouldn't be ran for over a minute lol

tight junco
#

that is

#

perhaps the dumbest sentence you've said today

#

but whatever

#

because you have skript doing scoreboard stuff and anything else is just mythic mobs, disguises or supervanish sending packets which is all going through protocol lib

dusky harness
tight junco
#

typically you wanna run spark when the sever is genuinely lagging but, im not spark expert but this doesnt seem that bad

worn jasper
#

then it like almost insta drops to 12 tps

tight junco
#

yeah i'd run the spark when that happens

worn jasper
#

ye already told him

dusky harness
#

also when possible you should let him know that he should update spark to latest

tight junco
#

although i do wonder how the fuck that plugin has 160 players with like

#

no plugins

#

well minimal

tight junco
#

nope that server

#

native english speaker of 18 years by the way

worn jasper
#

xD

#

also

tight junco
#

cant form correct sentences

worn jasper
#

2 words

#

Minehut & Box

tight junco
#

ah

worn jasper
#

the one type of server I still don't understand till this day

#

why people play in it

#

but whatever

dusky harness
#

are there a lot of people... messing with their inventory? 🥲

#

or chests

#

or GUIs

worn jasper
#

which uses packets

tight junco
#

welp there's your problem, minehut xd lol lmfao rolf

worn jasper
dusky harness
#

idk exactly what it is but Container.broadcastChanges -> triggerSlotListeners was probably being called a lot

tight junco
#

minehut is still incredibly weird

dusky harness
#

minehut somehow apparently I heard has good advertising

#

if you buy the rank

#

or smth

worn jasper
#

sus

#

public class ExploitFixPlugin extends JavaPlugin {
  public void onEnable() {
    ProtocolManager pm = ProtocolLibrary.getProtocolManager();
    final ExploitFixPlugin INSTANCE = this;
    pm.addPacketListener((PacketListener)new PacketAdapter((Plugin)this, ListenerPriority.NORMAL, new PacketType[] { PacketType.Play.Client.WINDOW_CLICK }) {
          public void onPacketReceiving(PacketEvent event) {
            PacketContainer packet = event.getPacket();
            int rawSlot = ((Integer)packet.getIntegers().read(2)).intValue();
            if (rawSlot == -999 || rawSlot == -1)
              return; 
            InventoryView view = event.getPlayer().getOpenInventory();
            if (rawSlot < 0 || rawSlot >= view.countSlots()) {
              event.setCancelled(true);
              Bukkit.getScheduler().runTask((Plugin)INSTANCE, () -> {
                    PlayerInvalidPacketKickEvent ev = new PlayerInvalidPacketKickEvent(event.getPlayer(), "Internal Exception: java.io.IOException: An existing connection was forcibly closed by the remote host");
                    Bukkit.getPluginManager().callEvent((Event)ev);
                    ev.getPlayer().kickPlayer(ev.getReason());
                  });
            } 
          }
        });
  }
}```
#

that's the plugin he has

dusky harness
#

ah

#

I see

worn jasper
#

probably is the issue

dusky harness
#

yeah that's to prevent people from exploiting spigot or paper not checking

worn jasper
#

lol

tight junco
#

manually typing out an io exception is psychotic though i love that

dusky harness
#

in like inventoryclickevent

#

and so it leads to errors

worn jasper
#

not specifically spigot?

dusky harness
#

it's an exploit

#

with the vanilla client and no modifications, it shouldn't be possible

#

it's purpose afaik is to mainly just spam the console and if the server sucks then lag it a bit

worn jasper
#

can send the jar here though

#

or DMs

dusky harness
#

I'm asking since I don't see anything like it in the spark report

worn jasper
#

InventoryExploitFix

#

it's the name

#

maybe it doesn't show cause it's all packet based?

#

so protocollib gets blamed?

dusky harness
#

Possibly but I'd think that it would still show up in spark (I think Timings does at least)

#

Might just be that there's so many players and minehut performance isn't great

#

since the laggiest parts apparently are from mythic mobs, disguise, and holographic displays

tight junco
#

i read the instance and instantly decided to stop

dusky harness
#

gotta get that fake singleton in there

lyric gyro
#

it's a variable inside the method lmaoo

worn jasper
dusky harness
#

I love how they end up just using this in PacketAdapter

#

but then later on uses INSTANCE

lyric gyro
#

good lord

#

fake ass kick message

worn jasper
#

ye 😂

tight junco
#

it's evil and i love it

lyric gyro
#

what does that even attempt to do lmao

#

"hey you can't use slots that do not exist"

dusky harness
#

yes

#

which can throw errors in other plugins that do not check

#

iirc

worn jasper
#

isn't there a better way to protect against this

dusky harness
# worn jasper isn't there a better way to protect against this
  • If possible, upgrade the minehut server or cap the player limit
    Looking at the spark report, this doesn't even show up at all in the spark report (was the plugin even installed and enabled?)

  • I know you already mentioned skript, but note that it and its addons takes 10.13% average of every tick

  • LibsDisguises - If this is installed only so that the server owner can troll as like a dog or something I'd remove it, although it only takes a fifth of what skript takes up (1.91%)

dusky harness
#

ah alr

#

then he can keep it

dusky harness
#

CPU > RAM

#

imo

lyric gyro
#

Using more than 16 GB is usually counterproductive and detrimental

worn jasper
#

ye

#

he probably has a memory leak somewhere

leaden sinew
#

Dkim no way you just said to remove Skript

worn jasper
#

lmao

worn jasper
dusky harness
#

😭

leaden sinew
#

NO

lyric gyro
dusky harness
#

Old logo smh

lyric gyro
leaden sinew
#

I can't believe you said to remove Skript

lyric gyro
dusky harness
#

Smh

lyric gyro
#

@icy shadow you seeing this shit

dusky harness
#

Am I the only one that types with my hand at WASD position

worn jasper
#

my hand is constantly on WASD

#

if I need it somewhere else, it goes somewhere else

#

but it's rest place is WASD

dusky harness
#

🥲

worn jasper
#

WASD = Home

dusky harness
#

Exactly

tight junco
#

hey is there any way in adventure api that lets people to center text very easily hm

dusky harness
#

goodbye home row

tight junco
#

damn

dusky harness
#

I don't think they would add something like that into the main API

tight junco
#

i was hoping there would be a <center>

worn jasper
dusky harness
#

and plus, some components don't have a set character count

#

ex TranslatableComponent

worn jasper
dusky harness
#

and then resource packs & chat size also mess with it

tight junco
#

any link blush_shy2

worn jasper
#

can't find the one with the adventure api pain

#

only found one for normal messages, which I don't even know if it works

dusky harness
#

it does

#

I tested

worn jasper
#

you could try it and adapt it? idk

worn jasper
dusky harness
#

yep

#

I think like everyone uses that one 🥲 🥲

#

even though the enum thing messes with auto import sometimes

#

and auto completion

worn jasper
#

could probably be adapted for adventure api

dusky harness
#

you could use LegacyComponentSerializer

worn jasper
#

no pls

dusky harness
#

🤨

#

I mean