#help-development
1 messages · Page 1069 of 1
malformed packet or sent at the wrong time
What do you mean by wrong time?
And what would cause it to be malformed?
Also it shouldn't be malformed since I'm using the native function to create the packet
Caused by: io.netty.handler.codec.DecoderException: Malformed public key bytes
It seems to be malformed :/
Why though?
I've deleted NoChatReports plugin and joined from a vanilla client and it seems to work fine
Could it be due to chat reports?
is this the best way to do infinite potion effects?
iirc there is an infinite duration constant
i understand Integer.MAX_VALUE = 3.4 years roughly but still... it doesn't look pretty lol
but I think its -1
so set it to -1 instead of Integer.MAX_VALUE
yeah try that
alright
pretty sure there's a constant for that
PotionEffect.INFINITE_DURATION
?
both work the same
which would be better practice?
INFINITE_DURATION is going to keep up with updates as long as you change the api version you're building against
does someone know how i can remove the tooltip for the spawners? thanks 🙂
yes thats the one I meant
i just remember it being set to -1
does anyone know if the scale attribute can be used on player?
that would be very funny but I'm guessing no
I'm told yes
really?
yes, i have done it
might be fun to have all players 0.5 or 2x size
I am not really an expert with databases, but I want my plugin to support bungee-like (velocity, waterfall, etc.) servers, so it will store config per-player in a database instad of a local file, so that the player will on any proxy have the same data in my minigame. My question is whether:
- this is a good idea?
- I should use JDBC?
- I can have multiple mysql connections with the same account concurrently accessing the same table (from different mc proxies)?
- yes 2. yes 3. yes
however, when changing servers behind a proxy the player will move to the new server before the quit event fires on the leaving server.
ie, the data on the SQL is likely to be out of date on the join
does somebody code with intellij?
I just set up a new Spigot project and added a server file so i can test and debug the plugin faster. This worked well, there is just one big problem if i try to make inputs in "Run" which is the console, like testing commands or op someone, nothing happens. I cant do any inputs in the console with intellij. But if i start the server itself without Intellij, and the normal console starts, everything works fine.
Does someone know how to solve this issue?
Somebody said i need to run it in the terminal but how do i do this?
just run the server in your terminal
Thank you for help. I think leaving won't be a problem, because I am not realying on storing data when player leaves but rather when he configures his stuff in-game.
I'm, trying to use a virtual anvil, but the gui does not work like a regular anvil. This is the code
// Create anvil inventory
Inventory inventory = Bukkit.createInventory(null, InventoryType.ANVIL);
// Open the anvil
player.openInventory(inventory);
Same goes for smithing table and maybe other inventory type too.
Hello, how can I do a multi-module gradle project to use mojmaps with spigot and nms ?
by creating multiple modules
Basically, I want the tutorial of mfnalex : https://blog.jeff-media.com/maven-multi-module-setup-for-supporting-different-nms-versions/ for gradle
well yeah, but I can't just create modules and put mfnalex's code, right ?
there is another thing necessary to group everything ?
wow it is
it is on, but not for the multi module setup
its exactly the same except the nms module has that
Multi module should be just making many modules and shadowing them into your core basically
no need of more code ?
Well, there is some gradle stuff
well there is more stuff but its basic
I think there was some method to get a module as a dependency
Just compileOnly the core for all the modules (besides the core ofc) and implementation all the modules in the cores build.gradle[.kts]
okay thanks
is impl like provided?
implementation is runtime classpath, compileOnly is compile classpath
let's try that, and destroy the base code (because he's using PAPER as a base, but for 1.20.5+, well goodbye spigot support because cb notation has been removed :/)
so compileonly is provided hmm
They remap at runtime
You don't need to worry about that
but well, that'll drop the support of my code in this channel lmao
implementation will be shadowed/shaded, compileOnly won't. You don't need to shade your core into modules but you need to shade the modules into the core
Paper does
Don't worry about what they do
They want to keep comp
papermc is slow to answer and I don't like them
and often they end up messing up
Paper patches my tnt duping so paper bad 😠
no what hes saying is if you have a jar obsfucated for spigot papermc will remap it when they load it and fix it
yeah, but if I have a specified cb package without 1_20_R... Will spigot remap that to the good package naming ?
Paper doing all this shit just to support spigot plugins lmao
Womp womp (jk)
no
what about cvn
for spigot it must inlude that, paper will remove it and make it work for papermc servers
so keeping the actual code (who uses paper as base) would drop spigot support for 1.20.5
no
If it uses paper and their tooling yes
if you use paperweight with paper mappings as a base yes it would drop spigot support
that's what it uses
if you want spigot support use the remapper that alex has
Everybody these days has their own remapper
🤮🤮🤮
Atleast they have a plugin
at least
hey userdev is great
but that's paper
They don't have a maven plugin though it goes both ways
and I'm a spigot one
it allows me to use remapped nms from my own fork within one line
But why use maven
real
maven is trash, raydan said that to me
Preference
that's false
that's 0*
MAven and Gradle are both fine. Its down to preference
maven is just for people who prefer maven
yeah, but how do i do that?
true
I like gradle more, because I can program it
just copy your plugin to your servers plugin directory and run the server jar
but the more I look to maven, the more I see that like "too many characters"
Allergic to making plugins?
I have a script for that lol
Pre-run tasks are build and then it just copies and runs
like, look at this thing
i use a gradle plugin for that but ok
why do you need the files
It's way easier to write three lines in a buildscript than to write a whole fucking maven plugin without having a single idea about the plugin api
1 👍
I'm looking for the snapshot version to use it to make plugins
Again preference and opinion, not maven is bad because of a valid reason
doesn't answer my question
use a proper buildtool
?maven
I never said maven is bad, I just said I prefer gradle because I can program it, or well, let's be more specific. I can easily program something in the buildscript without requiring me to build something, know some plugin api and whatever else
i prefer gradle because it has the kotlin dsl and i can just code something without having to look up how to do it
it's also more readable
I do need to know some gradle specific stuff, yes indeed, but it's just easier than maven in my opinion
And since I said "in my opinion" nobody can tell me anything, I'm protected
bro used protection
did that on your mom too
it was super effective
I predicated this message...
predicted ?
nah, I'm a gay
Paul de le français non speak engles
Oh, you mean not inside intellij?
toi c'est sûr que tu ne parles pas français 👍
mon non francąis non speak francąis
what is sûr
💀
sister
"you are sister"?
what
.
What is the difference between EntityTargetLivingEntityEvent
And EntityTargetEntityEvent?
Not sure to understand
a door is a entity ?
(TileEntity ?)
first one Called when an Entity targets a LivingEntity and can only target LivingEntity's.
No idea what entities they'd want to target thats not living
humm
Stranger
If I cancel entity targeting, it don't retry to target me directly?
it might, in the next tick
For my case I am doing it for a vanish plugin (I cancel player packets but entity can see me) maybe I just can give an invisibility effect ?
just cancel all target events if teh target is vanished
Zombie will not attack me if I cancel target ?
no
is there a skin packet to update player' skin for a specific player
So i cant use the console inside intellij then?
I also have to prevent enderman eyes contact and creeper explode, lot of évent to prevent, are you sure is not better to just give invisibility effect who fixe all thèse problems?
you can
yes you can
i dont understand
how?
you just copy your jar to your servers plugins folder
and then you run your server
but then the server starts outside intellij
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
idk, i just searched for a possibility to debug the plugin and not to leave intellij, so its more automized, but like i said the console doesnt work there
That link has two methods of debug
as a server and IDE as debug server
the second is probably what you want
thank you, i used method 3 already. But i cant execute commands like op or so inside this console
Is there a plugin that will remove the item on the floor with a every few minutes?
using 3, can you enable the redirect input from to select the IDE?
I guess not. I've never used it as I don;t use IJ
where could i do that?
hey does anyone know how i can remove that interact and the blue text?
ItemFlags
spawnerMeta.setItemFlags
does this work too?
that doesn't exists
mb its addItemFlags
no
its like ItemFlags.HIDE_ADDITIONAL_TOOLTIP or which ever
you can find the m in the docs
its either attributes or potion effects
yea
probably potion effects
^^
it's generally used for item specific descriptions
and i cant use removeItemFlags?
okey and why?
you add an item flag to hide a part of the lore
^^
thats how it works
by default no item flags are present
ah okey
if you remove the flags, it'll show all the things
so just like this: meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS, ItemFlag.HIDE_ATTRIBUTES);
?tas
hehe thank you
https://paste.md-5.net/hedotukovu.xml
am I being dumb?
where is this even coming from
change everything to 21 lmao
I only am just getting back into plugin development. It seems that the Material field for ItemStacks have become depreciated? How else am i supposed to set ItemStack material in an inventory??
Update intelliJ
invalidate caches
What does this have to do with my question though?\
Ofc i do, I'm just not following. I've invalidated my caches, IntelliJ is starting up. didn't mean to be rude btw
You're not, it's alright
Thank you, what's next?
Hm?
Wait I lied I was looking at the wrong api page
lol no worries
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
Uh after the update and ivalidation of caches, that should fix it? Try a restart on intelliJ maybe?
declaration: package: org.bukkit, enum: Material
Nothing here is deprecated so, like I said earlier intelliJ likes to fuck around
Ah, i should mention I'm not running this on 1.21. I'm using 1.20.5, Is it imperative that I use 1.21?
No, but the updating/invalidating should have fixed it
should with a grain of salt? It's always fixed it for other people
I'm looking at an API page and it's saying that Materials are depreciated 😭
Huh okay
I'm still not following I'm not gonna lie
Let me see if I can find someone else to help lol, I'm not sure what else would be causing the issue
I'm seeing that some other people have had the same issue, i'm going to dm them and see if they ever fixed it
let olivo finish
Maybe I am
declaration: package: org.bukkit.material
I sent him the correct api page: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
declaration: package: org.bukkit, enum: Material
Still in the waking up process so maybe I'm just dumb idk
I'm not really sure. When i try to declare a new ItemStack, it can't resolve "Material"
That would be an Intellij bug
what is your intellij version?
I knew it
Set Java version to 21 and update Intellij
Will do 👍
can't resolve != deprecated
btw :)
Ith that's what got me so confused
1.20.5
Well you did give them the correct solution so 🤷♂️
I only need to change the java version in the pom.xml correct?
yeah then reload maven
and set the jdk in project settings
it doesnt do that automatically when setting the lang level in pom?
not sure
Or at least when compiling
maven does the compiling
That's why I'd think the pom would be fine to just change but eh just to be safe do both
but then again I believe IJ sets the jdk it uses 🤷♂️
yeah do both
Fair enough
why do multiple lines of text displays sometimes center and sometime dont?
these pics are taken between one restart with no code change
maybe you dont need to use text display
what?
use armor stands
is that spawned on their head
is it a passenger
yes
@young knoll wakke up
why
no reason
only 🪭
smh
bru even us mods get timed out for it
lmfao
like its crazzy
wtf
LOL
did you try it conclube
does it let you untime urself out
idk tbh
onłyfans
i think not last time, but that was on phone so quite possible i could
you should try it
@worthy yarrow I assume u said the word?
minecraft cannot properly get the width of that character
IT WAS NEON
split the bitmap up
conclube can you untime me out in a minute
He peer pressured me into it 😦
lol well its revoked now
depends
oh
should i define it in the font setting
that's not a thing
wym
does EntityType still exist?
I tried to create a Npc at the players location with a command
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
if (player.hasPermission("createNPC")) {
Location loc = player.getLocation();
Villager npc = (Villager) loc.getWorld().spawnEntity(loc, EntityType.Villager);
npc.setCustomName("Click me for a menu!");
npc.setCustomNameVisible(true);
npc.setAI(false);
npc.setInvulnerable(true);
but Somehow Intellij says "EntityType" does not exist, while "spawnentity" needs a location and an EntityType.
Does somebody know what the problem is?
thanks cowoconcluwube
you cannot define the width 😂
height and width?
??
it doesn't do what you expect it to do here
how 2 fix
The font is the typeface that Minecraft uses. It was first added in Java Edition Classic 0.0.2a and has seen many revisions and additions since.
Its design has been present in all ports of the game.
In Java Edition, the font’s name is Minecraft Seven. It contains 2,426 characters. Multiple fonts can be defined and referenced with resource packs.
fix what
off center
and also the only way to fix it
kk thx
Hello! I'm having trouble with SnakeYAML refusing to import?
I import it by doing
import org.yaml.snakeyaml.Yaml;
but I get the error
error: package org.yaml.snakeyaml does not exist import org.yaml.snakeyaml.Yaml;
These are my dependencies in my build.gradle:
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.8.1'
implementation 'org.yaml:snakeyaml:2.2'
}
I even went directly to MavenCentral directly and got the implementation line from it
why are you classpathing plugins
Except when I try to compile my plugin it gives me the error in my original message
you should be adding them to the plugin block
IntelliJ told me to do it!
it certainly didn't do that
There are subprojects so I'm applying them later
(As in lower in the build file)
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
Isn't Player#setPlayerListName supposed to change the name in the tablist?
Certainly
does java 8 have custom model data feature
then it's acting up
Anyways, just figured out how to fix it, so ba bye!
Definitely
hasCustomModelData() and getCustomModelData() not working
changing the name in the GameProfile works and all but setting the tablist name with said method won't do shit
How you change it
i don't get what u mean in this context, lol
oh-
apparently i have to change the tablist name BEFORE changing the name in the GameProfile
lol
Wdym game profile
Wdym not working
it says Cannot resolve method
i wrote a method for FULLY changing the name, chat, tablist and gameprofile
basically a nick
What spigot version
Cannot resolve method 'hasCustomModelData' in 'ItemMeta'
what mc version
1.12
💀
💀
iirc you have to store the current variable on an object same in metas
1.12 is an interesting version to code on these days
i mean it seems to work now apparently
i think its not important i just selected it when i created the project
the java version is not related to the minecraft version
public static void setName(Player player, String name) {
GameProfile profile = getProfile(player);
try {
player.setPlayerListName(name);
player.setDisplayName(name);
Field field = profile.getClass().getDeclaredField("name");
field.setAccessible(true);
field.set(profile, name);
} catch (Exception ignored) {
player.sendMessage("Failed to change username.");
}
}
as well as anything <1.20
i'm making it for from 1.8 to 1.20
well the game version is like the most important part xD
then you have to use 1.8 api
but good luck with that 😛
just use 1.20
from what i've heard 1.8 api is so bad compared to today lol
why do you want to make it for so many different versions?
yea it's shit as it's EIGHT years old
because all plugins works from 1.8 to newest versions
💀
9
and i want it too
nnnno?
no 💀
still a lot of plugin supports 1.8
thats their fault
most popular plugins always support 1.8
I started on 1.8 but nobody is really playing that version anymore except for old aah pvp shit.
and since it didn't fit the purpose of the plugin i migrated to 1.19.2 and then to 1.19.4 (there was a lot of time in between the migration bc idk i got bored or sum)
I couldn't bother to migrate to 1.20 bc i think some stuff changed there and i was like "eh- not worth it. not yet"
depends on the purpose
some do but that's their issue
but i think there is no big difference between java 8 and java 17 etc.
there kinda is
yea but a bit znrelated to the mc version
like a L O T
please just use latest
or at least a fairly new version
1.20+
especially when you want to get into the topic of coding
did that much change between 1.19.4 and 1.20?
only versions you should really even consider supporting
1.20 update
i mean - that again - depends on the purpose of your plugin lmao
btw why lowest mc version option is 1.12 in project settings
what 🤨
what project settings?
what project setting
lol
when i create new project
what IDE are you using?
intellij
with the Minecraft Development Plugin, i suppose?
because 1.8 is ancient
mc dev plugin sucks
mcdev can be quite useful when working with mixins
lol for me the lowest version is 1.18 XDD
but that's not Spigot so no need for it
Not when you're cool like me and like to make 3d cuboid models
alright so i have this weapons and i modified its attribues, i noticed when changing a single one it removes the vanilla attributes (diamond sword) so i added them back as so
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(UUID.randomUUID() ,"generic.attack_damage", 7, AttributeModifier.Operation.ADD_NUMBER, getItemSlot(player.getInventory(), itemStack)));
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier(UUID.randomUUID(), "generic.attack_speed", 1.6, AttributeModifier.Operation.ADD_NUMBER, getItemSlot(player.getInventory(), itemStack)));
itemStack.setItemMeta(meta);```
but the attack speed seems to be a lot faster than usual, and from searching in the forums i found that the modified applies on top of the players attributes, so i set the attack speed to a negative number and that seemed to work, so now im just looking for a way to do this that dosent involve the negative number so that it can display properly as 1.6 instead of -2.4 on the weapon
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier(UUID.randomUUID(), "generic.attack_speed", -2.4, AttributeModifier.Operation.ADD_NUMBER, getItemSlot(player.getInventory(), itemStack)));
sorry for flood :/
you're not cool
you can't code in console
Yeah but you didn't make a 3d rep of a cube
kat refuses to leaen vim
yeah but i have no need for that
Your loss
lazyvim >>>>
also your loss
hahahah
what
we goin down the linux rabbit hole now?
sure why not
Maybe I'll learn vim later when I actually have a use
first thing: what linux version are you mainly using? i'm boring and use plain debian
my use is work lol
linux version? 💀
arch btw
cb273eb7c8390c70a484db6c79a797e377db09b5 fr
arch is a different breed
wut
what the fffffffffffffff
arch is love
real
its the latest githash on torvalds/linuxc
is
what wm you on
arsch
kek
😎

.
my cover is blown, i have no idea what wm is supposed to stand for
window manager
xfce 💀
desktop environment 💀
m
um
okay ig i barely scratched the unix surface
since i outed myself as a german yall pobably know (or not) that it's after 10pm and i gotta work tomorrow. gnight gang
yea i figured lol
was very comforting tbh when i realize then 7's nick is gestankbratwurst 
Deutschland 🇩🇪
insert one of your gifs here
its kinda up there so im just gonna give it a bump
java.lang.NoClassDefFoundError: com/mongodb/client/MongoClients
compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
testCompileOnly 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
implementation 'org.mongodb:mongodb-driver-sync:5.1.2'
implementation 'org.mongodb:mongodb-driver-core:5.1.2'
implementation 'org.mongodb:mongodb-driver-legacy:5.1.2'
implementation 'org.mongodb:bson:5.1.2'
compileOnly 'io.lumine:Mythic-Dist:5.6.1'
}```
are you using the shadow plugin?
no
you need to use it to create a shaded .jar (one with dependencies included)
so i just have to add the shadow plugin dependencies correct?
you add it to the plugins section and then run the shadowJar task or make build dependon shadowJar https://imperceptiblethoughts.com/shadow/getting-started/
no
use gooolers shadow
it works with java 21
Rip John shadow
thank yall for the help
If you don't plan on supporting versions older than 1.17 you can add the following to your plugin.yml:
libraries:
- 'org.mongodb:mongodb-driver-sync:5.1.2'
- 'org.mongodb:mongodb-driver-core:5.1.2'
- 'org.mongodb:mongodb-driver-legacy:5.1.2'
- 'org.mongodb:bson:5.1.2'
or as Alex and Rad said you need to shade using the shadow jar plugin for gradle
this only supports maven central tho
paper supports other repos with paper plugin loaders which you seem to be using already (paper)
correct im using paper
oh i just saw this
how can i send a custom achievement complete message?
Hello, what should I use instead of new NamespacedKey(string, string)) ?
new NamespacedKey("string:string") I think it was something like that
it doesn't exist
I think I've found
NamespacedKeyfromString
But well, you could probably use this one anyways
Probably
yeah it's fromString are you sure you actually have to use it
I don't like deprecated x)
well, it's for interacting with nms and doing some ResourceLocation, I don't think I have choice
It's not deprecated because it's gonna be removed, it's deprecated because Internal iirc
It's deprecated so people actually use their own plugins namespace
and not something else
or at least that's how I understood it 🤷♂️
I think I've heard it being used internally somewhere but I'm unsure
Could be new NamespacedKey("bukkit", somethingElse) or something, would fit the bukkit style
i have a feeling you want NamespacedKey.minecraft
nah, custom biomes
Why should I use build.gradle.kts instead of build.gradle for plugin development ?
kotlin v groovy
yeah
intellij has intellisense for kotlin
@blazing ocean, I appreciate the kotlin syntax
nothin for groovy
then I'll use kotlin x)
Thanks 😄
I like kotlin
Kotlin intellisense didn't work well for gradle last I tried it 🤷♂️
yes it does
it works for me
guess mine is broken
smh stop breaking gradle
private static BlockVector3 getBlockVector3(Player player, Location targetLocation, Location oppositeCorner) {
BlockVector3 pasteLocation = BlockVector3.at(
Math.min(targetLocation.getBlockX(), oppositeCorner.getBlockX()),
Math.min(targetLocation.getBlockY(), oppositeCorner.getBlockY()),
Math.min(targetLocation.getBlockZ(), oppositeCorner.getBlockZ())
);
BlockFace facing = player.getFacing();
int offsetX = 4;
int offsetZ = 2;
if (facing == BlockFace.NORTH) {
offsetX = -1;
offsetZ = -3;
}
pasteLocation = pasteLocation.add(BlockVector3.at(offsetX, 3, offsetZ));
return pasteLocation;
}```
You guys ever seen a more hardcoded solution?
Well I mean it's partially working
just like Groovys intellisense is working partially
looks like it's better than groovy one for now
i get intellisense on everything
this is beautiful
why isnt src a core module
because of the original author 💀
so modify it
more organized
I prefer like that
Huh, that person is actually well-known?
so you prefer more confusing stuff in the parent build.gradle over seperating the core stuff
yeah, it keeps the original aspect of a project, I like that
the settings.gradle.kts, gradlew.bat, gradlew, gradle.properties, build.gradle.kts, gradle and .gradle?
the reason i dont use gradle
maven
skull
you also don't need half of those
I prefer having some tiny files instead of a hundred lines just for ONE pom.xml
They all kinda suck who cares to argue about them kek
you only need a build.gradle.kts
saves people getting different wrappers
i prefer awful xml over caching half the universe, having a bunch of files and having a gradle daemon that always crashes 😳
.
gradlew -stop
easy 👍
a lot of people push all but .gradle to make it easier for other people to build, without it you could get someone with a different wrapper or gradlew and something could stand the chance to not work
but it literally just works without installing shit with the gradle wrapper
you see @tardy delta, my pom.xml for ONE module can't even fit in discord
pom.toml when
already preparing for the hate dms
this server seems to be collectively against toml files
bruh
toml ftw
last time you said toml sucks
well, we have yaml which works
someone else then
i'm a diehard toml enjoyer
how so
i think someone here said so
yeah but you can't type them by hand as nicely
I'm animating the tablist, animations can be changed once per tick, if 100 players have such a tablist that is constantly updated once per tick, will it affect the performance drastically?
as in a
- one
- two
oh yeah
:/
simply pom.h
I sadly cannot check whether a player looks at the tablist or not
would be less verbose
so how do big servers animate without performance loss
I think that's client side
yeah thats why i cant check
dwm mentioned
Is https://repo.md-5.net/ dead?
different thread
but they do take the hit
just, is md_5 dead ? yes
or they change as little as possible
tablist can be done async?
Looks like it
it can
nice
if you're doing nms yea
it's similar to chat no?
What's it even being used for?
api too i think
😠
packets can always be sent async iirc
oh yeah
ok
packets are all async anyway
but think of optimizing, change only what's necessaryy
or even offset steps to spread the load
I'm not 100% sure what I'm using it for, but the only dep I have that cant be found in the other repos I've added seems to be nocheatplus
but thats not possible, you always need to set the full footer or header
wait, are you only updating the header and footer?
thats what the tablist is isnt it
tab list is header, player list and footer
it shouldn't be that expensive then
updating header every tick for ~50 players isn't expensive at all for me
alright
Could probably just do a manual install of the project then
ncp is open source
i think the only bottleneck here would be component parsing
they should be
retro the packet man 💪
retro the limbo guy
yeah, im just going to vendor the jar, bit of a pain because adding it to .m2 locally doesnt really work in bazel :/
lol
but it's important to know what context you are in
sometimes you are already in an async context
where it might not be necessary to switch to another thread
hm can't bazel use the local .m2 repo?
That seems odd
as far as i know netty has a thread pool it uses, making it async from the get go
Looked it up it should be able to
with m2Local as the repo name
or are you talking about installing it to local?
huh, surprised it will do that, usually likes to be quite hermetic
i'll just stick the jar into git anyway, not like nocheatplus is receiving major updates
There is a maintained fork of it
ik, im only using the api so it shouldnt matter really
yes
doing heavy processing on netty threads can also overload the cpu and delay everything
leading to "higher" ping for everyone
very interesting
people often go crazy on async
and everything
frick the main thread
till they forget that its still running on their cpu kek
don't neglect the main thread unnecessarily
pretty much
Virtual threads are nice though
does fastutil not have concurrent support?
would need int2object of a concurrent hash map
It does not
I believe Trivago has a couple concurrent versions of fastutil maps
Not all of them though
I see none
I have a ConcurrentInt62Set, but not a map variant
Though uh, the way Trivago does concurrency is a bit laughable
aren't all sets implemented with an underlying map
?
What the heck is an Int62Set
that one is based on long-arrays at it's core, with 2 bits used for access control to ensure that no duplicate values are in the set
one bit is used to disable writing while the other bit is used to disable reading, it's a bit unintuitive but also not that complicated really
if you could send it
oh it really is 62set XD
is there a tutorial on how to custom generate (schematica) a region for a player?
I mean, why would it not be
example would be something like prison server's private mines
You can use the WorldEdit API for schematics
I think I'll just reimplement the int2objectopenhashmap into a concurrent one
Longs are still integers
Tell that to java!
I mean, writing concurrent data-structures isn't exactly straightforward - especially if one has never done it before.
Tell that to C
Be happy that you have no long long here
What about a short short
what if i want a short long int
have done it
I read the src of java's concurrent hash map
so I know how it works pretty much
If you consider slapping a synchronized on it "concurrent" then yeah - easy, otherwise not really
not on the whole object
Java's CHM uses APIs inaccessible to normal Java programs
only on the currently modified bucket
Just create an emoty world and assign "plots" to players
I am not a normal java program
Unsafe, my friend
Can give each player 200*200 blocks of space etc
Then your application will fail to start in newer versions of Java
i just cant figure out how to get the custom spacing to work
Why do you need custom spacing?
my future self will figure that one out
I hope
Kek
The methods used have been nuked in newer versions of Java (~J17), but the replacements don't yet exist in Java 8
It's not an instance of "oh, in a future version it's gone" but more like "oh, it's already gone"
Not exactly
You thankfully can still do quite a bit with AtomicIntegerFieldUpdater et al, it just wouldn't be a 1:1 copy of CHM
Packets are sent async, sure
I'll use an abstraction class and for newer versions the one reimplemented with VarHandle
But some incoming packets are often processed in the main thread
Especially packets related to blocks or entities
they are?
Let's start with a couple concepts
oh wait yeah, they are
For example, what we know as "the anchor point"
and for older I'll use Unsafe
simple
How i can disable that when player dont click any items the gui cant be closed?
Let's say you have a housing system where all houses are dynamically loaded and saved in the same world. In order to maintain data integrity (and make it all simple), we store everything as a "relative" or "delta" of the "anchor point"
Every schematic is pasted at the anchor point, and everything that can be configurable is also configured as relative positions
So you want the gui to be closed at any time?
In order to make it super simple, you can have an empty world where you build your house at 0, 128, 0 and that's your anchor point
For things like spawn points just use the same XZ and subtract 128 at the Y
Just don't cancel inventory close event
do cancel
It'd look like "Spawnpoint A is (0, 0, 3) blocks away from anchor"
ah wait what
He wants it to close
It’s not cancellable
Swm ftw
makes sense
The rest of the logic becomes trivial. You can use something like a grid to pick your anchor point
And everything else is relative to it
no like the gui cant be closed. But when player click something the inventory will close
Oh right you reopen
This is the effect you want?
uea
Then re open the inventory when the player closes it
If they didn't click the item yet
The grid can be in a single axis (anchor = 1000*houseId, 128, 0) or more complex (spiral pattern, potentially reusing indexes)
would i have to define my anchor point in something like my config.yml
Your anchor point is just assumed to be "0, 0, 0"
@EventHandler
public void onInventoryClicked(InventoryClickEvent event) {
if (!event.getInventory().equals(inventory)) return;
if (event.getCurrentItem().getType() == Material.GRASS_BLOCK) {
Player player = (Player) event.getWhoClicked();
Location location = new Location(player.getWorld(), 10, 1000, 10);
player.teleport(location);
}
}
@EventHandler
public void onInventoryClose(InventoryCloseEvent event) {
Player player = (Player) event;
while (player.getInventory().equals(inventory)){
player.openInventory(inventory)
}
}
I write this but the second handler dont work
Let's make the distinction between absolute and relative coordinates
Absolute coordinates are relative to 0,0,0, relative coordinates are relative to the anchor point
relative = absolute - anchor
absolute = relative + anchor
oh i know now wait i will try
You could store the anchor point and make everything absolute and just compute at runtime
You can store everything as relative and skip storing the anchor point
Don't use a while loop
Replace while with if
Another way of thinking of the anchor point is just to see it as "the island's center"
So that one table is 5 blocks above the island's center
The chest is 1, 0, 3 away from the island's center etc
I'm still looking for a reply, if anybody could help it'd be awesome
Ok i will try it
You need to not cancel the event if the player clicks the grass block
As for the grid, its entire job would be about picking/reserving the next available anchor point
got it I think i need to read up more on worldedit docs. does worldedit api do schematics the same as their command? such as pasting only on the corner of the position?
So you can pasted the schematic and load all relative data to it
You load a clipboard and then paste it at a location, yeah
Caused by: java.lang.ClassCastException: class org.bukkit.event.inventory.InventoryCloseEvent cannot be cast to class org.bukkit.entity.Player (org.bukkit.event.inventory.InventoryCloseEvent and org.bukkit.entity.Player are in unnamed module of loader java.net.URLClassLoader @108c4c35)
But wait i maybe found a solution
Don’t cast the event to a player
Event is not a player
Use event.getPlayer()
Ok
hummm ok in my mind currently is just making XZ cords 0,0 and depending on how big the schematic is, then subtract the size of the schematic to get the corner of the schematic and paste it there and have a interval number of how much times the schematic has been pasted and do (XZ cords of my first pasted schematic * (number of pasted schematics))
That's an example of a grid
Start with an interface and create some implementations
public interface MinecraftGrid {
Location reserveAnchorPoint(UUID islandId);
void disposeIsland(UUID islandId);
}
The islandId only matters if you care about reusing locations
This won't work 100% because I can unload an island in the middle of the list and it'll give the position at the end of the list type deal
wait whats the UUID for?
You kinda want an expanding array of indexes instead of using the list size
.
You can, for example, make a grid that loads a temporary world with the island id as its name
still not working or maybe i use it wrong because i dont want to close it when clicking esc too
does that mean i can sey a UUID for it or is it just automatically generated?
Can be anything, as long as it identifies the island / house / whatever
sorry havent used worldedit api at all so dont really understand these things
It could be something like
public class SingleAxisMinecraftGrid implements MinecraftGrid {
private static final double DISTANCE_PER_ISLAND = 1000.0;
private final UUID worldId; // Let's not store a hard reference to the World
private int ongoingIndex = 0;
public SingleAxisMinecraftGrid(World world) {
this.worldId = world.getUID();
}
@Override
public Location reserveAnchorPoint(UUID unused) {
return new Location(this.getWorld(), DISTANCE_PER_ISLAND * ongoingIndex++, 128, 0);
}
@Override
public void disposeIsland(UUID unused) {
// do nothing, we aren't tracking islands
}
private World getWorld() {
return Bukkit.getWorld(this.worldId);
}
}
ok I understand now thanks for your help!
Hello, how can I make my project support nms 1.20.5-1.21 while supporting java 17 (1.19-1.20.4) ? Because I can't compile with java 17, I get an error
I tried adding targetVersion to java 21 in the 1.20.5-1.21 modules, it drops the "class file being 65" as error
Here's my code :
https://github.com/Paulem79/BiomesAPI
You need to use the gooler fork of shadow
The old shadow isn't maintained anymore and doesn't support Java 21
does anyone have a plugin for passeges with a timer
okay sorry
As for HashMap, what's the condensed version of if(map.containsKey(uuid)) return map.get(uuid) else map.put(uuid, value) return map.get(uuid)
Did not expect that to be pinned 😂 thank you
Oh okay thanks 😄 nothing else to change ?
computeIfAbsent
oh wait illusion already replied oops
I've worked with Java very little since Java 8, so I'm not used to all these new things
yeah theres a lot of little methods you learn along the way
I still have 0 clue what streams are
fancy for loops
So what you're saying is.. I shouldn't be doing
stream().forEach(obj => obj) 💀
I'd avoid something simple like that
streams are pretty costly
do I need to write a TypeAdapter for Location so that Gson can do its thing with it? Pretty sure I'm getting an error from trying to deserialize some JSON into a List<Location> and it's not liking it
correct
yeah because of world
Weak reference world to be specific :p
apparently jackson doesn't ignore transient fields. lovely
i love you
😳
Man, gson is so slow but it works so much better than everything else
is jackson included or not
I've tried FST, kryo, jackson, gson
Isn’t there another one
hmm you ever tried it?
I need a better understanding of data structures and why yml/gson/etc are better in which cases
Does anyone know how to make an inventory that's different to every player? e.g. the player can sort the contents of the inventory by price, and things like that
i feel json just trumps everything tbh
Do you mean a personal shops sorta plugin?
kinda
Well like give me some reasons, I'd love to understand the debate more
I'm trying to do an auction plugin
Human readable but extremely easy to structure when it comes to complex objects
does not count on indentation
Ok so then one main gui for all currently auctioned items, helper guis for other operations such as checking your current auctioned items and whatnot
Doesn’t have proper comment support
true
yeah, but the main gui can be sort for the least expensive items, by name 'n things like that
Well what else?
It also has pages
So then you place items into the gui by these sorting definitions, comparators and whatnot
json libs tend to be way faster and more portable across langs
That's a pretty good reason
but then I would need to define a different GUI for each player, right?
and how could I make that?
yeah
but how could I remake the GUI only for the player that sorted it by e.g. price
and for the player that has it sorted by price and is on page 3
I don't think you need a whole new gui, just swap the way items are sorted within it
reopen the inv
Maybe a way to track state with the player eg: the sorting options
the problem is I haven't really messed with guis, so I don't know how to actually do it
Then reopen original gui with the sorting option param or something
theres nothing wrong with having a new Inventory instance for each player
You can either store an inventory object for each player
Or just make a new one each time
that's prob easier
but where should I start?
make an inventory manager
I just mean like you don't have to create a new gui ie:
inventory inventory = bukkit.createInventory,
You just reopen the original gui with a sorting param attached or something
where you keep track of who is using what inventory
Your code still decides how to populate the inventory so why not just have some support for differnet sorting methods
Creating a new instance vs a new object is what I'm trying to argue so maybe I'm just stoned and thats what he meant
If I want to create a new instance each time, how could I Bukkit.getPluginManager().registerEvents for each new GUI?
no
You don’t
have a manager which propagates the event
You just do it once and then delegate to the instance for that player
InventoryClickEvent holds the player, so for each time this method is called you could consider it an individual player
6 inventoryClickEvents means 6 different players clicking some inventory
do you guys think it makes most sense to order it by the way it shows up in package explorer
or group by functionality
no one really, its just incase someone needs to go back and find where it's registered
ig ctrl f exists
I'd still stick with functionality
I'd group them by functionality
As in all the slave listeners on one group, all the master ones on another
oh slave master handlers are different packages completely
Only time I'd do alphabetical order is if I have like a million packets in a folder and they all fall under the same category