#development
1 messages · Page 22 of 1
wiki.vg tells you what the packet is about, and packetwrapper tells you how to add it to your code
perfect combo
So, the pickup item packet's id is 65, would I put this? ```java
packetContainer.getIntegers().write(0, 65); // 65 for the id
so its not Packet.Play.Server.ANIMATION
ah, thanks
just going to show this message again
ints write(0, item entity id)
ints write(1, player id)```
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
no, that's fine
Looks good - try to print out a debug like ```java
Bukkit.getLogger().info("Item: " + e.getItem().isValid());
I am running ```java
e.setCancelled(true);
e.getItem().remove();
ok
oh
it does make a difference
don't remove it
I am removing the entity and then playing a packet using it
or I guess remove it right after you play the packet
yeah
sometimes I just don't think
alright, that works, thanks! I appreciate your help!
np 👍 👍 👍 👍
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?
damn
Dirty delete smh
thx
how can I set a entitiy's velocity to make it move x amount of blocks upwards
Entity has a setVelocity(Vector velocity) method you can use
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
Just get the entity's velocity, then add the difference to the Y axis for how far you want it to move.
aight let me try that
Its working with a player but for some reason it doesn't work with a armorstand idk why
or maybe is it coz the entity has a passenger on it?
but im pretty sure armourstand velocity has to be done differently
like #setVelocity(2.0) might not work because it doesn't have any
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");
}
}
}```
I believe disabling gravity on armour stands has that effect of simply not being able to move altogether
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
What I'm trying to say is that it has to be always on for it to move
aight let try it with gravity enabled
yeah if it's gravity is disabled it won't work
yea it works now, thanks
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
@NotNull
T spawn(@NotNull Location location, @NotNull Class clazz, @Nullable Consumer function)
throws IllegalArgumentException```
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.
an instance of the spawned Entity
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.
IllegalArgumentException - if either parameter is null or the Entity requested cannot be spawned
lol what
Why when I put setTransform before createPaste in worldedit api, createPaste methot cannot be resolved?
prob because of what setTransform returns
How do I remove the gray text that says inventory? Is there something I can manipulate using packets? https://imgur.com/a/kdGLByY
I think it's resource pack related
ohhhhhhhh
it's a custom gui overlay
fooled you didn't they!
😖
yeah
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
yeah, but I was thinking that I could change the inventory view name or something, but I couldnt find anything on my own
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
oh actually
Text gets overlayed after, I imagine that would be the case.
in the json file you can configure all of the messages
for different languages, I might be able to make it blank
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
The URL that the server owner used was https://textures.minecraft.net/texture/5e2e4cdf27e32dc18b6064cddcfe1ffb1f38d1481bd7c472ea123076a078503f
Have you tried it yourself? Looks right to me.
It's possible they got ratelimited
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
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.
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);
AffineTransform is immutable, rotateY returns a new transform with the rotation applied
damn, thank you
Can you get a Chunk from its x and z? Or do you just have to multiply it by 16 and do World#getChunkAt
World#getChunkAt?
lmao
delete the messages NOW
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
don't worry, he does that already
👀
you've done that many times to me
bit of a double standard
i do NOT forgive you
Convert points to chunk or region data with bit shifting for speed
I mean as long as it‘s a constant the jit will do that for you anyways
Did anyone run into any issues using Reflections dependency?
what issues are you facing?
My issue is, that everytime the server restarts, the jar somehow grows in size and does not load at all.
and I get this goofy ahh error
What does "does not load at all" mean?
the thing above
Collect classes, register them as enchantments, same for listeners
Uh oh that doesn’t look good
do you even need javaassist for that?
if classes come from your own jar
javassist isn't just for other jars
well, the only related thing I found was
https://git.mythiccraft.io/mythiccraft/MythicMobs/-/issues/638
but I doubt it's a 'virus' or wtv
The fact that it looks obfuscated is really sus
yeah but can you not get all classes from your own jar that extend a certain class without javassist?
javassist is an instrumentation library, it's not directly tied to classpath scanning
also, I'm using implementation, should it be a compileOnly?
So yeah, that malware thing might be reasonable
I assume it wont work at all if I dont add it with shadowjar
m0dii, build your jar, then run it on a fresh server with no other plugins
clean and build
yeah include any dependencies
redownload them from spigot though
don't copy anything from the existing server
well, in a clean environment it seems like everythings as it should be after restarting
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
surely
well if its malware u have to do it anyways?
There’s a class f with a method b, maybe you can find it in some jar file
Or well, javassist/f
no only plugins using javaassist i would have thought?
as said here
@sterile hinge is there any guarantee those classes exist outside of runtime
No, but the naming doesn’t sound like it’s something official tbh
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 💀
Could also try https://github.com/OpticFusion1/MCAntiMalware as suggested by #492517675680006144 message (there are multiple related messages below)
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
yeah I'm saying it's easy to do that, without using reflections
Just create one class with a custom annotation processor 
Who let a pig be a developer O.o
its that simple that a pig can do it
So im just that bad?
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
yes 
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
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
you can't modify existing code, but you can generate a file that just does all the registering on one method for all other classes, then you only need to call that method once
you could just write an ap to create META-INF/services/ files and register them that way
ServiceLoader my beloved
sadly its not used enough with by mc devs
because it doesn't work well with the classloader mess from my experience
thats just classloader stuff
just put the classloader in the overloaded ServiceLoader.load(Class<?>, ClassLoader) method
that only works if you're controlling it that much
wdym
when using a library that uses the ServiceLoader api, you can't controll how that library loads services
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
Not always a feasible thing
Bukkit's class loading is simply shit and a clusterfuck and broken
esp when using the library loader
if anyone is interested regarding this topic
most of them use javaassist, so not a viable solution to go through all of them
every time the server starts (the plugin is loaded)
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
which is why sirywell linked the thing he linked
welp

idk
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?
latter i would guess
yeah it's the latter
its basically a trojan horse
Someone used a leaked plugin lol
that would explain it, where it came from
owell, at least now I have some mess to fix from previous dev
its modified every plugin? interesting
I think paper released something to check your jars and then blamed spigot saying users accounts got hacked.
I can confirm that definitely did not happen
Most of these come from leaked plugins
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;
}
Depend on luckperms and use meta 😊
trueeee
🤔
We've seen a lot of reports of a new malware going around Minecraft servers. It seems to be spread by compromised Spigot plugin-author accounts, and is somewhat difficult to detect. We do know that the following exception is caused by it:
From paper's forums "Malware Announcement"
never used that
use luckperms api (i think they are asking)
Lp meta is just perfect
But if you really want to use perms, it might have a better api for filtering idk
I mean, they aren't wrong? indirectly. Spigot is literally the place where 98% get their plugins, it's not stupid to blame them lol
(if that makes sense)
Is not spigot's fault directly that accounts got hacked
wasnt it just 1 plugin?
I mean, I will take a deeper look at it, although from a first impression it looks complex as hell lol
and 1 acc that got compromised or smth
is just getMeta("key") and then parseInt
it isn't, 2FA exists, etc. BUT if you were to blame someone, like, if you really had to, it would be spigot in general
And you can configure lp to give you the highest/lowest value
am I looking in the wrong place? lol cause it looks a lot more than that lmao
Idk only place I've see compromised plugins is leaks. Not the actual authors account on spigot.
You get the user, access its data then go to meta bla bla
Lp api seems complexe at first but it is hella powerful
Isn't someone working on PermissionsEx 3.0?
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
oh okay, that's cooolll I guess
add an Ints::tryParse there
where?
getMetaValue takes a function as second param
alright, well, I redownloaded all the plugins and I still get this
oh ok
Have you also installed a new server jar and delete all folders where libraries can be?
yeh
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
I guess if you use perms right and ptero, it shouldn't be able to exit the server container
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)
The size of the jar should be noticeable bigger from my experience, like additional mb
[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?
no?
wth?
the virus spreads from one jar to the rest.
so having ONE jar infected is already enough to infect everything else.
well, I mean, from the Spigot.INFO.Non-Vanilla Enchantment
A node in luckperms is a permission right?
Yes
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
If its that specific virus, then yes. But this software looks for all kinds of them.
Its not necessarily the one that spreads
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
import org.apache.tools.ant.filters.ReplaceTokens
https://github.com/Rosewood-Development/RoseLoot/blob/master/build.gradle#L85
Assuming you're doing this in a plugin and want the plugin.yml to automatically update with build.gradle defined version
JavaPlugin#getDescription().getVersion()
if thats not what you want then
L i guess
** 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
still risky to keep it there.
Is this inside a plugin, you never defined because the resources package is in every java project
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
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
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
whats the problem & what have u got so far
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
so im trying to do something like this
but atm i only have it per command registered
Would you like to see the code
i can upload too gitlabfor ya
Why would you edit github to gitlab 😭
Github > gitlab
I use gitlab so I can make project private when I need to it’s just my preference
isn't that possible on gh without premium for a while now?
Is it ?? I’ll have too look into that as I’d prefer GitHub tbh
Private repos were behind a paywall?
Jeez
cmon github
well I can tell you for sure that it's not behind a paywall anymore
yeah like 5 years ago or something like that
Its not and otherwise just get github student
Easy fix
Gives you github pilot aswell
*copilot
and all jetbrains tools
All for free 😌
I don't use most of them but I have it anyways 🥲
anyone know how per module is a separate GitHub project ?
Anyone know how i can add commands too ACF Help Command manually ?
So with this class when in game for some reason i have to do /gma gma
instead of just /gma
i use ACF btw
on server stop, when are players kicked?
before plugin disable afaik
my plugin saves on player leave (async, using a task)
I don't think player leave is called
but when server stops, players are kicked
it's after I'm pretty sure
so how would i do it?
since in onDisable you can see
in onDisable you don't have to do async
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.
you sure player quit/kick event is not called then
Heya Luna!

100%
well even if it is called you can't get it
so it doesn't even matter
nice! i'll take a look then
should? depends if you want or not. if you want to create your own stuff then I guess so.
but yes. learn at least the basics of java before getting into plugins
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!
I mean it really depends
if people want to consider it or not

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.

i'll have to find a place to study then xd
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
yeah, i mean to find a place to study (irl) idk the word ("in person"? xdd)
is it me or should this not happen with acf https://prnt.sc/XWEtl6W9p3vJ
Is there a way I can use the CustomModelid system for entities?
Sorry for the ping, but I am getting some issues with MetaValues... like I am getting the metavalue of a perm and it's returning null?
Like, I am pretty sure I have the perm plugin.level.1 but getting the metavalue of plugin.level isn't returning anything
meta is set with /lp user [user] meta set [key] [value]
oh...
How do i check if an item with itemmeta is right clicked?
@NotNull
public ClickType getClick()```
Gets the ClickType for this event.
This is insulated against changes to the inventory by other plugins.
the type of inventory click
if click type is right click, get item meta, check if meta is null, continue on with whatever
Not working, I want to right click a nether star that has a custom name etc, and if that item is right clicked then it will do something
is this in a gui or the hand
click by holding it? PlayerInteractEvent
Hand
d;playerinteractevent#getitem
@Nullable
public ItemStack getItem()```
Returns the item in hand represented by this event
ItemStack the item used
welp that would of been helpful
How do i check if the player right clicked the item?
d;spigot PlayerInteractEvent#getAction
@NotNull
public Action getAction()```
Returns the action type
Action returns the type of interaction
is there a easy way to format numbers like for example 5130 to 5.1k
Use google and a stackoverflow post will come up
average programmer
Divide by the number variant and add the symbol
or get copilot and get that to do it for you
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
CompactNumberFormatter moment
thanks
Np
That exists?
public final class CompactNumberFormat
extends NumberFormat```
CompactNumberFormat has 1 extensions, 2 all implementations, and 21 methods.
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.
12
Interesting how it is also localized, I want to see what lame ass format romanian has
lol

anyone know how i can get these color codes working in console https://prnt.sc/25pQNkZt0-Jy
You need to send a message to the console command sender
d;spigot ConsoleCommandSender
public interface ConsoleCommandSender
extends CommandSender, Conversable```
ConsoleCommandSender has 2 extensions, and 4 super interfaces.
okay
how can I create a Sign GUI to get a player's input
void openSign(@NotNull Sign sign)```
Opens an editor window for the specified sign
sign - The sign to open
all
guys, please tell me how to use Cyrillic and unicode characters in minimessage
please
and how can I get the input of it?
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 😭
Just don't use NMS, ez
Don't really have a choice for some things
If you're using latest, you can use the unmapped jar and remap it with the maven plugin
or paperweight with gradle 😎
or if you're not using 1.14+ then screamingsandals gradle plugin
you really do have to check every method possible that means you don't need NMS
??
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
Well IDK about the other user but NMS is a must have for me lol
NBTTags, ChunkData/block manipulation etc...
NBTTags - NBTAPI
idk what you mean by chunk data and block manipulation
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 
Requires a third party api
No point when I have my own xD
You need NMS for it. You have to create a NMS item
Ok but it still requires NMS lmfao
I meant that I don't need to do any NMS myself
instead the developer of NBTAPI does
The conversation is what is required
also, NBTAPI handles multiple versions for you whereas with spigot remapping for example, it's not as simple
Just cause the API does it... Doesn't mean its not being done lol
yeah but it removes the downsides of using NMS
yeah you're completely missing the point of the conversation
^^
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
Thats not the convo.
The convo is NMS is used no matter using that API or not. NMS is still used.
I mean Ori was the one that started this convo
afaik NMS isn't good to use due to you having to do extra work to support multiple versions and that it's not documented
NBTAPI fixes both of those issues, so why would NMS be an issue if it's all handled in the library?
This portion is what we started talking about
Not if NMS is required for what that user was doing.
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
Ori started it off before those messages by saying that you should check everything in the spigot api to make sure you need NMS
which is where the confusion came from
I feel like you just blatantly don't read and pull shit out your ass LMFAO
????????????
They probably meant they dont need to import NMS because they have NBTAPI to do it for them
If you think about it, spigot and paper api uses NMS too
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
you thought that he meant that it means in the libraries too (although now that I think about it) which is understandable but once you hear what Ori actually meant, why don't you understand?
and instead you send... this
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
Didn't I confirm?
here
NMS does all the work for me
and
i dont even think my first sentence was that confusing
here
I'm just going to assume that Yapperyapps doesn't use many libraries such as NBTAPI which aims to reduce the usage of NMS in the project so he didn't recognize what you meant
but I hope he recognizes it now
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...).
And you can have that superiority complex i guess
🥲
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
lol think what you want
you saying that reminded me of people wanting to make their whole server custom including their permissions plugin 💀
👋
anyway this isnt really a difficult concept to grasp but sure
paint supremacy honestly
I did that with my minigames server.
there should of really been an extra question of
"do you really have to add this feature" but i got impatient
I had some hope
but now
im just gonna watch some youtube
and let Ori say the rest
yeah im done anyway
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
Aw cmon his discord acc is deleted so I can't even check his old messages
unfortunate
You can search by ID (pretty sure)
Oh misread lol
🥲 yeah idk why it doesn't work
even though Copy ID works
Search sometimes doesn't work for me so IDK
the ID copied from deleted users is the all same
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
oh
Thats not true
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
The SQL GC person?
💀 i forgot about that dude lmao
yeah vision
They had some great ideas
I just copied multiple different id's from delete accounts
if you pay close attention here, they are all the same
💀
Show me some "Deleted accounts" then?
actually
it might be a two things at once could be true
they could be older accoutns so they're delted in a different way
nah the one in luckperms is from 2016 and it's the same
No clue both are deleted accounts
These are the 2 classes
https://paste.helpch.at/xemuhelupu.java
https://paste.helpch.at/eviquciriv.java
And for some reason when I open a sign gui for a player
It sends me this error
https://paste.helpch.at/josonatilu.rb
You can probably create a sign without setting it in the world, uh?
what
how?
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait
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
@Default
h
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
You could look at WorldEdit / WorldGuard source code, they might have something
i have tried this but it doesnt actually work
skill issue
ima just recode the cllass i think ive found the issue
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
You could just attach a temporary PDC to them
Why don't you want to listen to the respawn event?
although when they die would it stay onto them?
I didn't want to setup the map
and then like a join/leave listener
etc
I'm pretty sure it does
No problem
And if it doesn't, that means I've probably messed up some past plugins lol
💀
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;
}
what's the exact full error?
not all items are damageable
stupidly enough, every itemmeta implements damageable
it keeps giving an error
thats what I thought
entity.Damageable
oh
Wrong Damageable import
d;org.bukkit.inventory.meta.damageable
public interface Damageable
extends ItemMeta```
Damageable has 1 extensions, 4 super interfaces, and 4 methods.
Represents an item that has durability and can take damage.
I think the max is in the Material
yea
damageable only give you the damage, which you need to subtract from material#getMaxDurability to find out the remaining 'health' of the item
Yeah IDK why they start durability at 0 🤦
the damage starts at 0, not the durability 🙂
yeah
thanks
uhm I have heard ProtocolLib is quite bad in terms of performance, is that true?
I don't think so
hmm
I'm pretty sure it's very performant
v5 has been reworked entirely and it isn't as shitty anymore
Velocity
may I ask why?
(I mean, I kinda know why but just making sure lol)
besides that, TAB doesn't support velocity which sucks lmao
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
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-
You don't say?
velocity was literally made by the waterfall dev
intended to be a complete rewrite of the shitty bungeecord api
I didn't ask
💀
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?
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
Early morning Emi
Best Emi
the point is them connecting to velocity then to waterfall
velocity would handle the first connection
which is usually where the issues are I assume
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
oof regarding performance, how performant is velocity compared to waterfall?
really gotta choose one oof
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
- some bungeecord plugins are just builtin features of velocity
like bungeeguard, fallback server etc
... bungeecord has fallback server last time I checked.
"But I noticed this does not work if a player is on a server and the server gets turned off/restarted. For example if somebody is on the survival server and I restart it, they just get kicked from the game, not sent to the next server on the priority list." https://www.reddit.com/r/admincraft/comments/jc810r/bungeecord_fall_back_server/
velocity sends u to hub if backend server ur on gets shutdown
might be different now as the post was 2 years old
Probably not
what did you require? I only recall TAB from what you said
isn't safenet better than bungeeguard? (at least from what I have heard)
It uses base64 to ensure encryption all the way through
its basically a merge of ipwhitelist and bungeeguard
but velocity's "native bungeeguard integration" isn't quite like that either, it's the same principle but different
I think
which?
Hopefully nothing
never heard of it
isnt base64 not encryption
also safenet also supports geyser which is also cool
bungeeguard does aswell?
huh
Yeah not really, it's about an encrypted as wingdings
no idea lol
it does
I mean, idk it myself, I just heard safenet was better
bungeeguard is a server only thing
never did the research
protects ur server from bungeecord exploits
I mean ideally you wouldn't need either of those solutions
I bet velocity doesn't protect against Bungeecord exploits
And get a real firewall instead
There is no bungeecord exploits on velocity
LMFAO
You got the joke, grats
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
That is not true
but also has legacy bungeecord and bungeeguard support
You can use velocity without using the forwarding stuff
Yes
true
but
no
atleast u dont have to install a plugin to use it
yes it will work, but it has a secure function builtin bungeecord does not
mb for miswording it
⭐
TAB, VelocityResourcePacks, PistonMOTD, Maintenance, Luckperms, LibertyBans, ajQueue, VentureChat
very solid for me
good selection of plugins!
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
yeah, u would be surprised of the number of people who use shared
Oh I know
wait, what specifically is the 2nd one?
manages resource packs per backend server
Proxy wide resourcepacks?
or you can share it on multiple and it doesn't resend when you do server swap
cant ya just do that on the backend side?
Ah
thats handy
oh ok cool
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
wait but TAB doesn't support velocity though
cheater 😮
ive never tried Snap but snap might work?
for TAB
https://github.com/NearVanilla/bat this exists?
breh what
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?
yeah just call cancel
Easiest question ever
I mean it doesn't instatly stop... It's stop that when it call that again....
Are you asking how you would stop the task when the game ends?
yeah
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
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?
You should probably use an actual database
Keep clans in memory and just loop through then when needed
And save to a mysql when needed
was asked to use json
¯_(ツ)_/¯
Could just store clan ID/name to players PDC
Yeah that’s what I would do, although I’m not sure why you’re being asked to use JSON for this
I mean, yes. But I have had an issue in the past where PDC's would take time to load, so if I tried getting it right after the player joined, it wouldn't work lol.
idk why
I mean if they’re going to force you to use a bad storage option, it’s their fault when the performance is bad
MongoDatabase
this is a funny line in retrospect
like "bro's going ape shit"
but mongo yk
he mentioned mongo once, so maybe?
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?
Either way shouldn't it be cached in memory?
Which would result in the same performance
Or be running async
Not even an estimate was discussed beforehand? 🤨
still didn't accept the commission
I am just brainstorming lol
Yeah but lookup times before caching
That should be running asynchronously
Ah alr
Yeah but it still might need to search thousands of files
Why do you have thousands of data files
Exactly

Idk if that's better practice since if one gets corrupted the rest is still there
But thousands is a lot
I know
I usually just do 1 bc I'm lazy 🥲
That’s still not great either
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
Yeah this is not a great use case for JSON storage in my opinion
what can I say ¯_(ツ)_/¯
@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 :<
How are you calling it?
Calling what?
I'm doing ConversationCommand.COMMAND from another class if that is what you mean
Oh sorry I missed you were doing it in the same class
Oh yeah that would do it lol, I was just going back to check a project I used annotations for
🧠
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
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
yeah looks like there is some bad ItemStack
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
run spark for 5 mins + try ticks over 50
Spark shouldn't be ran for over a minute lol
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
no idea, will ask him lol
protocollib shows as lagging when another plugin lags in its listeners iirc (I don't remember exactly what library/plugin but I remember it happening in others too)
typically you wanna run spark when the sever is genuinely lagging but, im not spark expert but this doesnt seem that bad
his server is fine until it reaches 160 players
then it like almost insta drops to 12 tps
yeah i'd run the spark when that happens
ye already told him
also when possible you should let him know that he should update spark to latest
although i do wonder how the fuck that plugin has 160 players with like
no plugins
well minimal
that plugin?
cant form correct sentences
ah
the one type of server I still don't understand till this day
why people play in it
but whatever
maybe, I know he has a plugin to fix an inventory expoit
which uses packets
welp there's your problem, minehut xd lol lmfao rolf
they have a custom plan to my knowledge
I'm not sure if that's coming from a packet listener
idk exactly what it is but Container.broadcastChanges -> triggerSlotListeners was probably being called a lot
minehut is still incredibly weird
minehut somehow apparently I heard has good advertising
if you buy the rank
or smth
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
probably is the issue
yeah that's to prevent people from exploiting spigot or paper not checking
lol
manually typing out an io exception is psychotic though i love that
wdym
plugins don't check if the slot is valid
in like inventoryclickevent
and so it leads to errors
but that's a plugin issue then
not specifically spigot?
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
what's the plugin name?
custom made
can send the jar here though
or DMs
I'm asking since I don't see anything like it in the spark report
InventoryExploitFix
it's the name
maybe it doesn't show cause it's all packet based?
so protocollib gets blamed?
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
lmao the instance
i read the instance and instantly decided to stop
gotta get that fake singleton in there
it's a variable inside the method lmaoo
no comments, wasn't me that coded it :-:
I love how they end up just using this in PacketAdapter
but then later on uses INSTANCE
ye 😂
it's evil and i love it
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%)
think it's for donors
actually it's already 31.2gb of memory and it's only using 23gb, so it seems like it's being bottlenecked by its CPU
CPU > RAM
imo
Using more than 16 GB is usually counterproductive and detrimental
Dkim no way you just said to remove Skript
lmao
yes pls
NO

Old logo smh

I can't believe you said to remove Skript

Smh
@icy shadow you seeing this shit
Am I the only one that types with my hand at WASD position
nop
my hand is constantly on WASD
if I need it somewhere else, it goes somewhere else
but it's rest place is WASD
🥲
WASD = Home
Exactly
hey is there any way in adventure api that lets people to center text very easily 
goodbye home row
Nope
damn
I don't think they would add something like that into the main API
i was hoping there would be a <center>
no but... think someone already did a snippet for that
and plus, some components don't have a set character count
ex TranslatableComponent
ye that snippet adds this
and then resource packs & chat size also mess with it
any link 
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
you could try it and adapt it? idk
which?
speaking about this one: https://www.spigotmc.org/threads/free-code-sending-perfectly-centered-chat-message.95872/
Font Info Enumeration: http://pastebin.com/9Be2DF2z
Method to send: http://pastebin.com/BADd6K43
Many just recommend using a...
yep
I think like everyone uses that one 🥲 🥲
even though the enum thing messes with auto import sometimes
and auto completion
could probably be adapted for adventure api
you could use LegacyComponentSerializer
no pls

