#help-development
1 messages ยท Page 279 of 1
is it possible with a merchant get which villager is it trading with?
I'll give that a try
Don't quite get the question, sorry. I use reflection to find the parts of NMS (or rather net.minecraft.network, depending on the version) I need and then invoke them.
What would that ever change, xD
Yup, cleaned it and it's fixed
was a compiler bug
No idea how we still have to deal with that in 2022, but yeah... lol
Maybe I'm a bit lost right now, I'll just trust you.
Something like this?
List<PlayerStat> toReturn = new ArrayList<>();
for (UUID uuid : getAllUuids()) {
Profile profile = ProfileManager.getProfile(uuid);
if (profile != null) {
toReturn.add(stat);
}
}
return toReturn;
}```
This is to get total amount of specific stat, for example kills
Yeah sure, but the packet is dead simple, there's not much except one field I don't understand, and I've seen people just putting a zero there, so I did too, xDD. But I guess mappings could help a lot to understand what the fields are for.
Did I do it correctly?
what's Annihilation line 38?
Which ID?
Have a look at the paste I've sent you. I am accessing the CraftPlayer->handle (EntityPlayer)->activeContainer (Container)->windowId (public int)
It's a window ID, not an inventory ID. But I know what you mean, but the inv itself doesn't have an ID.
The ID is basically an AUTO_INCREMENT on every entity.
Now you have a list of stats rather than the total amount
Of course not, which is why I put my reflection lib to use, xD.
But it should have a public int
so do you have any ideas?
Okay, I'm currently hacking together a simple injector to read the vanilla packet and see if I maybe malformed some of it's parameters. I'll update you if I get the name update to work.
How do I get a bossBar to sync to a clock/countdown timer
You set progress on that timer
like
how do I keep the bossbar updating
so it syncs with the timer thread
so I have a variable time
I just want all players' bossbars to sync to that time variable
so if time changes to 1, the title of the bossbar changes to 1
you send a new message
Youd just update all players bossbars whenever you set the time, not sure why this is a problem rn
aight
No because I'm trying to take into consideration like what if a new player joins
half-way the timer
Dont have the methods in front of me but there should be a settitle method or something
My current code
downside is if a new player joins, they won't receive the time
or bossbar
Cant you just do something similar foreach Bukkit.getonlineplayers?
You can listen to PlayerJoinEvent I guess?
Foreach online players will work too
yeah i do
You're creating a thread for every players online ๐
yeah, thus why I'm trying to change it ๐
use the bukkit scheduler
โ
tbh I havent read the code at all, I only saw "new Thread" and reccommended the bukkit scheduler
xDD. There's most definitely some deviation I could notice on the new packets I tried to send. The first print is the vanilla instance.
Hi! I would be interested to know how the plotMe plugin works. I rewrote the plot size and nothing changed. What could I do?
It happened but nothing changed.
it probably requires a restart
does any1 here know how i can have personal scoreboards and also have the players be in the same team (so they can see eachother when invisable as ghost) ?
Yes restart happened but nothing has changed. (i don't usually press reload)
Well, I think I got bad news, :(
state resets...
Maybe I'm missing something, but I don't think so
Don't yet know what the last two integers are all about
Where do I find classes with proper named variables again real quick? xD
Yeah sure, the items stay now
Because the whole frickin inventory state is pushed to the client at every title change
but that sucks, :(
remapped jar
Yes, the state stays constant now, and I can even take items out and put them back in. But it seems glitchy, as the client is being reset at every title change.
yep, 1 sec
Oh, right, I can upload it straight on discord, lol
whats ur version
using PlayerInteractEntityEvent to know when a player accesses the villager, is it set to cancel on its own if another player is interacting with the villager or do i need to check myself if anyone else is trading with the villager?
1.13.1, currently
Yeah, sorry, I always procrastinated on reading up on this. I know how bukkit works, the whole remap, patch, compile and stuff, but I just never could be bothered to actually look deeper into it. Thank you! :)
It doesn't change the fact that there's still a huge underlying performance issue. It's exactly as I thought, updating the title makes the client drop state. This way, there's nothing new about it, we've always done it like this. You could just as well open a new inventory on every new frame then, has the exact same effect.
I'm only updating on every 2nd tick, you should be able to do so on every tick if the idea actually worked.
ViaVersion is Mobbing me :/
java.lang.IllegalArgumentException: ViaVersion has not loaded the platform yet
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
at com.viaversion.viaversion.api.Via.manager(Via.java:84)
at com.viaversion.viaversion.api.Via.getPlatform(Via.java:64)
at com.viaversion.viaversion.util.Config.getListSafe(Config.java:230)
at com.viaversion.viaversion.configuration.AbstractViaConfig.loadBlockedProtocolVersions(AbstractViaConfig.java:166)
at com.viaversion.viaversion.configuration.AbstractViaConfig.loadFields(AbstractViaConfig.java:135)
at com.viaversion.viaversion.bungee.platform.BungeeViaConfig.loadFields(BungeeViaConfig.java:44)
at com.viaversion.viaversion.configuration.AbstractViaConfig.reloadConfig(AbstractViaConfig.java:102)
at com.viaversion.viaversion.bungee.platform.BungeeViaConfig.<init>(BungeeViaConfig.java:39)
at com.viaversion.viaversion.BungeePlugin.onLoad(BungeePlugin.java:75)
at net.md_5.bungee.api.plugin.PluginManager.enablePlugin(PluginManager.java:344)
at net.md_5.bungee.api.plugin.PluginManager.loadPlugins(PluginManager.java:250)
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:281)
at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)
at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
List Versions.
**- - - <1.7
- '1.9'
- 1.9.1
- 1.9.2
- 1.9.3
- '1.10'
- '1.11'
- 1.11.1
- '1.12'
- 1.12.1
- 1.12.2
- '1.13'
- 1.13.1
- 1.13.2
- '1.14'
- 1.14.1
- 1.14.2
- 1.14.3
- 1.14.4
- '1.15'
- 1.15.1
- 1.15.2
- '1.16'
- 1.16.1
- 1.16.2
- 1.16.3
- 1.16.4
- '1.17'
- 1.17.1
- '1.18'
- 1.18.2
- '1.19'
- 1.19.1
**
ok
i mean, if list of versions is up to 1.19.1, doesnt that mean u are using a older version on smth? or is your server in 1.19.1 and via version as well?
what version is via version on and what version is the server?
Lost .-.
do you just want all version above 1.9 to join?
1.8 And Higher also All versions
Okay, actually I wasn't quite right about this. It doesn't send the whole contents over and over again. The AIR item set there at slot -1 seems weird, maybe that's used to force the client to update...
And maybe you were right about the speed, although that disappoints me. I really want to bang a fully fluid title through the socket, lol.
you need via rewind as well then, and you dont need to edit any configs
default for all 3 plugins will work
what?
and how can i this fix with the versions?
LTS = Lates
latest via version plugin is for 1.19.3, is your server in that version too?
yeah is
ah ok
delete the 3 folders and let it regen the configs, then you dont need to edit anything
then u need viarewind for 1.8
ok
^^
Wow its work thanks ๐
Noob question: Why isn't the spigot.jar my build-tools compiled deobfuscated? Seems like this would be the easiest solution. How do you get that remapped jar then?
did you build with the --remapped flag
?nms
facepalm
I should put some ads on the website so I can earn 0.00000002$ everytime someone asks this question lol
lol
I'm gonna be so rich
you could also add rick roll auto playing at the bottom of each page
oh yeah I could just add that into this "discord" snippet
and in the header I'll add a pic of imajin sitting on the loo
but first he has to send me such a pic
which he probably won't
To be honest, It's just such a stupid topic. This whole legal bullshit... As if it wasn't enough to deal with this modification clusterfuck alone and how hard everything is to hook into already.
But hey, thanks guys, I know know how to get the mappings applied, lol.
?dmca moment
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
yeah sorry but that's not my fault lol
No, but you shouldn't act like "many people ask it because they're not willing to google".
I did not say that
I just said, totally neutral, that this questions comes up here a lot
Well, alright then, :).
I wouldn't have written that blog post if I wouldn't be trying to help people ๐
do we like Wolvereness or not like him
No, I get that, I see that you do help out a lot. I just got the feeling that this answer was a bit snarky. That's on me then.
Nah, I'm just very touchy. Sorry again.
all good my friend
"oh no, my bad"
"nonono, its on me"
"nah mate, my bad"
"nah, you're totally good, its my fault"
see everyone? this is how discussions should look like haha
what a healthy discussion
no hate, just love โค๏ธ
anyone?
what the heck is a Wolvereness
?dmca
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
oh the bukkit dude
he filed a dmca for loads of craftbukkit code
I don't have any opinion about him
Haha :D. Well, I think it's far easier to just be honest about mistakes rather than to try to cover them up till the end by acting like a 5 year old, xD.
[WARNING] The requested profile "remapped" could not be activated because it does not exist.
What did I mess up? D:
i cant tell if him filing the dmca was to try and fuck over spigot or mojang forcing him to because he "worked" for them
well if some court decided that the dmca was indeed justified, then he was kinda right to file a dmca
Ran this command:
/Library/Java/JavaVirtualMachines/jdk-11.0.15.1.jdk/Contents/Home/bin/java -jar BuildTools.jar --rev 1.13.1 --remapped
remapped only exists for 1.17+
yeah that part i get i just dont know whos side he was on
Oooooh, these are the official remaps, huh? So only since the refactor...
ther are official mappings for 1.14.1+ too but buildtools wont build them for you
Damn, I'm behind.
if he wanted the bukkit/spigot stuff to continue or he was forced to
spigot switched to mojang mappings in 1.17, before that it used their own class names and stuff
im guessing thats when mojang released their obsfucation map
Are these maps accessible anywhere? I kinda need 1.13.1, :-:
my fucking god, 1.14 was 2019
or the obsfucation map was released in 2019
Oh, that's an actual site, I thought it was some kinda joke, lol
here's the announcement of when spigot switched to moj mappings https://www.spigotmc.org/threads/spigot-bungeecord-1-17-1-17-1.510208/
lol no
it's the best mappings viewer imho
damn
wait 1.17 was 2021
it seems so much older
what the fuck
when did 1.18 release
1.17 was july 2021 IIRC
nov 2021
yeah it's been slow since 1.19
when 1.16 was released I still had a GIRLfriend
imagine that
arent they now changing type since 1.19.3
wdym
Uhm, am I just blind or are there no mappings available? Says that it uses spigot, but only presents gibberish fields again.
https://nms.screamingsandals.org/1.13.1/net/minecraft/server/VVV/PacketPlayOutOpenWindow.html
they are going to release more 1.19.something versions or something like that
as said, mojang mappings are 1.14.4+
before that there were no proper mappings
at least no official ones
Jeah, but there gotta be some "underground" mappings, like... Hundreds of people work on this stuff
spigot 1.16 and below uses it's own class names
they translated "some" fields etc, but most of them are just a, b, c
i remember trying to play with them ๐
I just thought that at least all packets should be mapped, as bukkit hugely depends on knowing them well. Oh man, this makes me wanna give up on minecraft again...
however nobody uses 1.13 and stuff anymore anyway. everyone is either stuck on 1.8.8 or 1.12.2 or 1.16.5 or using 1.19+
the version i see a load of people on is 1.17
Just happens that I had 1.13 set up at my local server, no idea why, nothing specific.
i see 1.16 sometimes but normally higher
update server lol
you can get a paper server online
all those people on 1.16 are using some weird hybrid fork from my experience
magma or catserver or similar
or, mohist (even worse)
Well, I want to make my stuff work on all versions (as far as it makes sense), ideally. So I should execute it once everywhere.
that sounds like multi version projects
I always just go for 1.16+
nobody complained about "why it no works in 1.8??!?!?!?!" in years
Still think that a proper packet layout differ to check what changeed accross multiple versions would be nice.
i dont want to use lower than java 16 so i just will use 1.17 and higher or that
Smart decision, I just cannot get myself to do that. I don't know, it's... hard for me. I don't see the need to not support something which takes me another three lines of code at the lowest abstraction level. The hard part is figuring those three lines out
Lol, thank you, how did you find that?
which ones?
Which versions, you mean?
no I mean, what are the "three lines" you are struggling with
Wow, thank you! That seems like a very helpful page I should be keeping in my favourites.
whut
am I stupid? but the link you sent doesn't work for me
select 1.13.2 up top right
I just mean... if I'm operating at a pretty abstract level and only make direct use of very core features which only very slightly changed (even over many years), then it would be a shame if I couldn't just react to those minor changes in a way that still makes my whole tower of software work.
For example this window title animation. If the window open packet only got like minor parameter makeovers, it would be sad if I completely drop anything below 1.16+. I could just figure out the other constructors or field sequences and instruct my fuzzy matcher to match them depending on the loaded server version.
But for that we would need a proper diffing between versions tool which - ideally - generates this kind of code. I thought about doing that a wile ago, but then got depressed again, lol.
Those are the "three lines of code" I spoke about, it's more a metaphor than an actual need I got right now.
I got that too and just re-searched the class myself, xDD.
ah okay. I usually just use modules for multi-version stuff
then when a new version comes out I just copy/paste the latest module directory, rename it, and then check whether it compiles lmao
Ah yes, the healthy approach. I'm at the "write everything yourself, because you don't trust anybody and gotta have full control and gotta know everything about everything and burn yourself out every month" approach. Lol.
Btw, is anybody here using the IdeaVIM plugin? I think it keeps crashing my IDE... But I'm not sure, trying to find the cause. These crashes happen like every hour.
yeah I never had any problems
but I'm using it on IJ ultimate
can you send a stacktrace?
Well, it just freezes up and I kill it, :(.
I'm on macOS and M1 tho, that might add to the issue.
alex funnily enough is also on macos lol
I thought I saw a windows application appearance there? lol
Oh, it was macos indeed, I didn't look carefully enough at the window details.
lol
I'm on mac too, but still an intel mac
I got a "normal" pc and a mac, currently I'm on mac
here's proof lol
HA I KNEW IT
YESTERDAY I SAID THAT NETFLIX BLOCKS SCREENSHOTS
and it indeed does, but only on mac
and everyone thought I am stupid
disable hardware acceleration
well I don't need to take screenshots of netflix
Hmm, alrighty then. Weird. It often happens when I quickly execute something like cw newName <esc> <cmd-s>, xD. Maybe I'm just going to reinstall if I once feel like it.
everyone already knows the office anyway. if not, their fault
hm weird, idk. without a proper stacktrace,it's hard to tell what's going wrong lol
No unix host with virtualized macos and windows hosts, two gpus and direct passthrough? I'm disappointed.
oh I got proxmox for that
except for the gpu part lol
my mac only has integrated intel gpu ๐ฅฒ
Tbh, I'm happy that all of that tinkering is gone for now, as I finally got a real macbook. Was a hackintosher for a few years before that, xD. But damn, I don't think I'll ever go back to intel.
yeah thats' probably the reason
:(
there's a reason why developers release seperate "Intel" and "M1" chip apps seperately
I'm still waiting for the M2 macbooks
unfortunately they only released the 13" with m2 yet
but I want 16 inch
ouch, must suck
M1 support just sucks to be honest. Things are out for so long and there's almost nothing working.
like minecraft and multithreading
minecraft works perfectly
Like Fusion360. What the fuck are these multi million dollar companies thinking?
but you can't play proper beefy games
doesn't it have some emulator thingy builtin?
fr
Like, I have windows bootcamp
with the mac, no. but that's why I still have a normal pc
ah, fair enough
Yeah, but that only gets you so far. Most things are way worse than they would be natively. M1 is a beast which cannot unfold at all.
i use my mac for normal things like coding, minecraft, and ... ermmm. definitely "not adult" movies, and my normal PC to shoot some people in gta online or kill some kerbals in KSP
M1 is a really good chip
Honestly
my suggestion is to just bootcamp windows
You cannot bootcamp on M1
isn't bootcamp deprecated?
Only use parallels, and I have no money to buy that.
can you not? wtf??
And mac-torrent-download got killed.
is there even a windows version for ARM?
And even then, you'd have to use ARM windows, which is a pice of shit in itself.
fuck ubuntu
yeah ubuntu is shit
bruh wow lol
it looks like an ipad from 2014
Ubuntu server*
ubuntu is shit because canocical promised "we will never replace apt with snap". and then (a year later) they replaced apt with snap
such controversy ๐
also ubuntu tends to break when going across versions
I just always use plain old debian
fair
the packages are older, sure, but at least they work
I recently upgraded a VM from debian 7 to debian 11 and it worked fine
on ubuntu this probably would not have worked
btw upgrade your macOS o0
When it comes to server OS' my knowledge it limited
Nope, crying in 2014
big surrr
I would if I could ๐
I was thinking of like
Force-Installing Ventura
but I realised what's the point
yeah okay that's like 8 years now
It requires me to fresh install my computer
I already have so many files which I need
windows 11 sucks
ye
windows 10 best
limited to only specific CPU types
10 is best, I agree
Congrats ๐
adult movies in 8k
does your bandwidth even go up to 2.5gbit lol
๐ณ
sometimes
i have 100mbps lol
wtf
sometimes it's even much lower
but yeah welcome to german internet infrastructure lol
over wifi (on the mac) I only get 50mbit D:
my ethernet is slow asf too
@quaint mantle Player#updateInventory does send a PacketPlayOutWindowItems, containing all items within the inventory. That's the only reason why this "animation" works. The PacketPlayOutOpenWindow resets the window's state at the client. There are no other parameters available, so no more things to try.
what do you need that packet for btw?
renaming inventories?
I actually had a method for that in JeffLib
but guess what
I removed it because it didnt work properly ahaha
Because that huge load of items going accross the network is something I think you'd most definitely want to avoid.
yeah I also used packets but I dont remember what exactly the problem was
It would work properly, but it just isn't efficient at all.
If you go at like 5 ticks per frame, it works out, actually. But that still is such a haaaaack...
Have you ever seen it work without updating afterwards? Just curious.
Alrighty. I'mma take a break from all of this, but I'm sure we're gonna get back at this later on. If I get any other ideas, I'll try them out in the mean time.
It's not saving Jar /inventories/ files inside the plug-in dataFolder, help?
public void load() {
// Create the subfolder in the plugin's data folder if it doesn't already exist
File subFolderFile = new File(plugin.getDataFolder(), subFolder);
if (!subFolderFile.exists()) {
subFolderFile.mkdirs();
}
if(subFolderFile.listFiles() == null) return;
// Save the resources from the inventories subfolder in the plugin's jar to the plugin's data folder
for(String fileName : subFolderFile.list()) {
plugin.saveResource(subFolder + "/" + fileName, false);
}
// Load the YAML files from the subfolder in the plugin's data folder into the cache
File[] files = subFolderFile.listFiles();
if (files == null) {
// subFolder does not exist or is not a directory
return;
}
for (File file : files) {
if (file.getName().endsWith(".yml")) {
// Load file with .yml extension
YamlConfiguration config = YamlConfiguration.loadConfiguration(file);
CACHE.put(file.getName().toLowerCase().replace(".yml", ""), config);
}
}
}```
Force opening stonecutter
you are looping over an empty folder
you basically only save the files that are already there, which are probably... none
you also should never hardcode the / char
but use System.separator or however it's called
or File.separator
i dont remember the exact name
to return what?
The internal id for the inv
Use an Holder
Woah
It's for packet reasons but it'd be nice to have access to it
How can I obtain files inside jar to saveResource them?
You mean find which files are inside a jar?
I want to save/copy every file inside /res/inventories/ to /datafolder/inventories/
Look at findLocaleResources()
?scheduling
What you do is run a repeating task with 20 ticks interval
ah right
Every time it runs, you can subtract 1 second
aight
congrats: money โญ
whats wrrong with creating a map of inventories?
^^
Think it'll get accepted if I create a pr?
Fk it, I'll try
Ik
That's what I'm gonna do
But why not make it easier in tje future
Yes but not when you need to support many versions
What if I want to reflect the entire user's project since this will become a library?
org.reflections.ReflectionsException: could not use param ''
How can I do that?
public static Set<Class<?>> getClickExecutorClasses(String name) {
Reflections reflections = new Reflections(""); //HERE'S THE EXCEPTION
Set<Class<?>> rawResult = reflections.getTypesAnnotatedWith(ClickExecutor.class);
Set<Class<?>> result = new HashSet<>();
for(Class<?> clazz : rawResult) {
if(clazz.getAnnotation(ClickExecutor.class).inventoryName().equals(name)) {
result.add(clazz);
}
}
return result;
}```
get their package name?
anyone have an idea why my server is freezing (1.8.8)
Current Thread: Server thread
PID: 16 | Suspended: false | Native: false | State: RUNNABLE
Stack:
app//net.minecraft.server.v1_8_R3.Chunk.a(Chunk.java:894)
app//net.minecraft.server.v1_8_R3.World.a(World.java:2516)
app//net.minecraft.server.v1_8_R3.World.getEntities(World.java:2503)
app//net.minecraft.server.v1_8_R3.World.getCubes(World.java:1214)
app//net.minecraft.server.v1_8_R3.Entity.move(Entity.java:442)
app//net.minecraft.server.v1_8_R3.EntityLiving.g(EntityLiving.java:1394)
app//net.minecraft.server.v1_8_R3.EntityHuman.g(EntityHuman.java:1355)
app//net.minecraft.server.v1_8_R3.EntityLiving.m(EntityLiving.java:1651)
app//net.minecraft.server.v1_8_R3.EntityHuman.m(EntityHuman.java:393)
app//net.minecraft.server.v1_8_R3.EntityLiving.t_(EntityLiving.java:1486)
app//net.minecraft.server.v1_8_R3.EntityHuman.t_(EntityHuman.java:173)
app//net.minecraft.server.v1_8_R3.EntityPlayer.l(EntityPlayer.java:285)
app//net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:382)
app//net.minecraft.server.v1_8_R3.PacketPlayInFlying.a(SourceFile:126)
app//net.minecraft.server.v1_8_R3.PacketPlayInFlying$PacketPlayInLook.a(SourceFile:88)
app//net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13)
java.base@11.0.17/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
java.base@11.0.17/java.util.concurrent.FutureTask.run(FutureTask.java:264)
app//net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44)
app//net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:714)
app//net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
app//net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:653)
app//net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:556)
java.base@11.0.17/java.lang.Thread.run(Thread.java:829)```
the method is
public <T extends Entity> void a(Class<? extends T> oclass, AxisAlignedBB axisalignedbb, List<T> list, Predicate<? super T> predicate) {
int i = MathHelper.floor((axisalignedbb.b - 2.0) / 16.0);
int j = MathHelper.floor((axisalignedbb.e + 2.0) / 16.0);
i = MathHelper.clamp(i, 0, this.entitySlices.length - 1);
j = MathHelper.clamp(j, 0, this.entitySlices.length - 1);
label37:
for(int k = i; k <= j; ++k) {
Iterator iterator = this.entitySlices[k].iterator();
while(true) {
Entity entity;
do {
do {
do {
if (!iterator.hasNext()) {
continue label37;
}
entity = (Entity)iterator.next(); (*******894******)
} while(!oclass.isInstance(entity));
} while(!entity.getBoundingBox().b(axisalignedbb));
} while(predicate != null && !predicate.apply(entity));
list.add(entity);
}
}
}```
tf
you what
and the mapped version is
public <T extends Entity> void getEntitiesOfTypeWithinAAAB(Class <? extends T > entityClass, AxisAlignedBB aabb, List<T> listToFill, Predicate <? super T > p_177430_4_)
{
int i = MathHelper.floor_double((aabb.minY - 2.0D) / 16.0D);
int j = MathHelper.floor_double((aabb.maxY + 2.0D) / 16.0D);
i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1);
j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1);
for (int k = i; k <= j; ++k)
{
for (T t : this.entityLists[k].getByClass(entityClass))
{
if (t.getEntityBoundingBox().intersectsWith(aabb) && (p_177430_4_ == null || p_177430_4_.apply(t)))
{
listToFill.add(t);
}
}
}
}```
@EventHandler
public void onClose(InventoryCloseEvent e) {
Player p = (Player) e.getPlayer();
if (!BedwarsStorage.pmenustorage.containsKey(e.getPlayer())) return;
if (!cancelled) return;
BedwarsStorage.pmenustorage.put(p, RequestMenu.createInv());
p.openInventory(BedwarsStorage.pmenustorage.get(p));
}
This InventoryCloseEvent opens an inventory that isn't listened to at all by my InventoryClickEvent listener, can anyone tell me why
Is there an option I can add to my plugin.yml to prevent my plugin from loading if certain other plugins are also loading?
Or do I have to use java?
Window-IDs are relative for each player tho, if you mean that ID.
They are. Every EntityPlayer has a non-static containerCounter
I think they are
They just start out at one and increment for every new inventory within this session.
A bukkit inventory is just a blueprint as well as a small state machine. You set your items and many players can interact with it, changing it, where those changes can propagate to all other viewers. But it cannot ever correspond to a single window-id on any client.
You can easily extend that tho. Loop the inventory's viewers and get the ID of their currently active container.
Dosn't look like it: https://www.spigotmc.org/wiki/plugin-yml/. There's no inverse of depend/softdepend/loadbefore. You'll have to wait in onEnable until all plugins are loaded and then check the target plugin's presence and conditionally disable your own plugin.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
How can I Invoke that Method?
Error: [18:10:46] [Server thread/WARN]: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "obj" is null [18:10:46] [Server thread/WARN]: at java.base/java.lang.reflect.Method.invoke(Method.java:561) [18:10:46] [Server thread/WARN]: at it.mikeslab.labutil.event.EventCloseExecutor.lambda$loadCloseEvent$0(EventCloseExecutor.java:29) [18:10:46] [Server thread/WARN]: at it.mikeslab.labutil.event.EventsManager.onClose(EventsManager.java:32) [18:10:46] [Server thread/WARN]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [18:10:46] [Server thread/WARN]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) [18:10:46] [Server thread/WARN]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [18:10:46] [Server thread/WARN]: at java.base/java.lang.reflect.Method.invoke(Method.java:568) ...
Class (Dont worry, it's short):
https://pastebin.com/gaywc6Rh
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Would help if you could post the whole stacktrace.
You mean if other plugins are present?
Updated with the most useful parts
ig its this
EventCloseExecutor.java:29 yields } catch (Exception exception) {, are you sure that stacktrace is in sync with the current state of your file?
public static Set<Class<?>> getClickExecutorClasses(String name) {
Reflections reflections = new Reflections("it.mikeslab.labutil");
Set<Class<?>> rawResult = reflections.getTypesAnnotatedWith(ClickExecutor.class);
Set<Class<?>> result = new HashSet<>();
for(Class<?> clazz : rawResult) {
if(clazz.getAnnotation(ClickExecutor.class).inventoryName().equals(name)) {
result.add(clazz);
}
}
return result;
}
what is the DamageCause for worldborder damage?
Yeah, just added by error an extra line between invoke and Class<?>.
The error appears over the method#invoke method
I think what actually throws is the method you're invoking, not the actual invoke. If that was null, the stacktrace wouldn't say Cannot invoke "Object.getClass()" because "obj" is null
Ooooh
My lord...
That's the method that should be invoked.
@CloseEvent
public void onClose(InventoryCloseEvent event) {
System.out.println("Closed");
}
The first arg has to be either null for no object instance (static method) or the instance you want to invoke the method on.
You're passing a class
ย method.invoke(clazz, e); How did that line came to be? #invoke has (inst, args...)
clazz is a Java Class, not an Instance
Yes, e is right, clazz needs to be swapped out for a reference to the instance of the class the method's in.
Not it's actual class<?> type.
is the InventoryOpenEvent called only when a player opens their personal inventory?
Or is it called when they open any inv (i.e. chest, hopper, furnace, etc)
Called for any inventory which opens non-clientside-only
So I need a "real" class not a Class<?>, thats the problem, right?
You need the Object (instance) where you call new <your_method's_containing_class>(...);
You have to instantiate the class somewhere, right?
How do you think it'll load then
Reflection can also instantiate, :).
Then keep a local singleton instance.
Search it's default-constructor and call #newInstance
for(Class<?> closeExecutor : annotated) {
// // = closeExecutor.newInstance();
I should pass that inside the map
and use it
Instead of passing a Class<?>, pass an Object.
Object instance = closeExecutor;
closeExecutor.getDeclaredConstructor().newInstance();
getDeclaredConstructor() yields the default empty constructor. If you need any dependencies in that class (references to any other objects), it get's more complicated than that.
THANK YOU, FINALLY IT WORKS!!!!!!!!!!!!!!
No more reflections to do
finally back to java
then you change your constructor and everything breaks
record constructors are even more pain
at that point i'd just want to do Unsafe#allocateInstance
Happy to hear that, feel free to ask again if you have any further issues. Just saying: As long as you want this whole ExecutorUtil.getClickExecutorClasses business to work, you really have to keep an empty constructors OR have a local dependency registry in the EventCloseExecutor where you try to find a match for each constructor parameter.
What I'd recommend to you (you probably won't like it, but it'll solve most of your problems): Have a #register on EventCloseExecutor where you pass an instance, just like #registerEvents from Bukkit. You thus can call new() yourself, pass all dependencies and don't have to worry about automatic dependency injection.
I did what you're trying to do a long time ago, with all args, but you really have to be comfortable with reflect for that.
making a reflective pojo mapper was fun i can say
The problem is that if you got the required tools at your disposal, you're most likely gonna produce an immensely overengineered solution which just doesn't have to be as complicated as it is, xDD.
Thank you for the idea ๐
Oooh, a relational db object mapper?
kinda
i gave up cuz the creating of statement became to difficult to do with reflections
a simple insert works lol
Haha, I also did that once. It's a great way to learn more, but just not doable for production. Way too much work, you'll get nothing else done.
why is a method like this?
Oh man, memories... lol.
i'm using getItemInHand
its deprecated
I'm sorry Blvck, just one last question
How can I disable that [18:43:20] [Server thread/INFO]: Reflections took 1 ms to scan 1 urls, producing 8 keys and 21 values
thing in console?
Because there are different hands nowadays
use player.getInventory().getItemInMainHand()
or InOffHand
thank you
so its saying
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: CustomVanillaRecipes has been compiled by a more recent version of the Java Runtime (class file version 63.0), this version of the Java Runtime only recognizes class file versions up to 61.0
update server ver
and i switched to compile with java 17 instead of 19 but that no work
google class formats versiosn
Very good question, I don't know what library you're using. Mind showing me the invocation where you scan for classes? Btw, scanning for classes can be done without any libraries, I once wrote a utility-method for it I can give you, if you'd like.
How did you switch
i switched what i compiled with, i went in intellij and switched it from 19 to 17
Do you use maven?
yes
You need to change it in your pom.xml
yeah i did
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
thats right for 17 instead of 19 right
I'm using org.reflections.
It would be amazing, thank you so much!
public static Set<Class<?>> getClickExecutorClasses(String name) {
Reflections reflections = new Reflections("it.mikeslab.labutil");
Set<Class<?>> rawResult = reflections.getTypesAnnotatedWith(ClickExecutor.class);
Set<Class<?>> result = new HashSet<>();
for(Class<?> clazz : rawResult) {
if(clazz.getAnnotation(ClickExecutor.class).inventoryName().equals(name)) {
result.add(clazz);
}
}
return result;
}```
yeah it doesnt work i changed the pom file and i change the projects java jdk
How do you compile the jar? Using the maven-compiler-plugin?
ummm ig, i click the maven thing on the right and then go into lifecycle then do package like the tutorial said to
And you r pom
Have a look at that method. You should pretty much be able to copy-paste it. It only works for packages in your own JAR tho. For root, leave the parameter as an empty string.
?paste
Yeah, paste your pom please
in this link?
this one
That link was ment for @green prism
done
send the link
Paste the url
Btw, you probably use IntelliJ, right? Did you click the little maven update button?
the one that floats in the middle of the code editor place?
Yes
near the top right
yeah i clicked the floaty thing
Or this one, which is always available.
oh that no 1 sec
let me test it to see if anything changed
and i click package should i click compile instead?
Do clean install
Every lifecycle invokes all of it's above siblings.
press control twice then type mvn clean package, for future builds press the green play button near the top right
But package generally builds a jar.
okay i clicked pakage so ill test it rq
no it still gives the same error
[ERROR] .... Could not load 'plugins/Custom-Vanilla-Recipies-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: CustomVanillaRecipes has been compiled by a more recent version of the Java Runtime (class file version 63.0), this version of the Java Runtime only recognizes class file versions up to 61.0
Can anyone help me?
Here's my code
@EventHandler
public void onPlayerEatP(PlayerInteractEvent playerDoingTheAction) {
Action azione = playerDoingTheAction.getAction();
Player playerThatEats = playerDoingTheAction.getPlayer();
ItemStack pork = new ItemStack(Material.GRILLED_PORK);
ItemStack foodBeingEaten = ((PlayerInventory) playerThatEats).getItemInMainHand();
ItemStack rowPorkchop = new ItemStack(Material.PORK);
if((azione == Action.RIGHT_CLICK_BLOCK || azione == Action.RIGHT_CLICK_AIR)) {
if(foodBeingEaten == rowPorkchop || foodBeingEaten == pork) {
double health = playerThatEats.getHealth();
playerThatEats.setHealth(health - 1);
}}}}```
damn wait a sec
so now there is this error: [ERROR] .... Fatal error trying to convert CustomVanillaRecipes v1.0:CustomVanillaRecipes.class
and this one:
[ERROR] .... Error occurred while enabling CustomVanillaRecipes v1.0 (Is it up to date?)
java.lang.IllegalArgumentException: Crafting rows should be 1, 2, or 3 characters, not [4]
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:193) ~[guava-31.0.1-jre.jar:?]
you have more than 3 characters for a recipe
That's not java-version-related then, I guess.
?paste the class
are you talking to me? sorry
on line 26 the "R R" has 2 spaces not one
what doesnt work with yuor code
i dont get damage when i eat porkchop
whein i right click on air or on a block with porkchop in my main hand
How can I make players not push each other?
Player#setCollidable nor Player#spigot#setCollidableWithEntities
doesn't work
your problem is that your casting a player to an inventory
yeah thx
thx for all yalls help it works now ๐
use playerThatEats.getInventory().getItemInMainHand()
I guess the PlayerItemConsumeEvent would be a better match for eating anything, except you want to immediately act when the item is being used.
^^
oke thank you guys
It's fine tbh.
I remember vaguely that you can use scoreboard teams for this, so that players on the same team cannot collide with each other. Could be that all public APIs just do something similar behind the scenes, but I haven't investigated that close enough.
Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
Team team = scoreboard.registerNewTeam("no_collisions");
team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
for(Player p : Bukkit.getOnlinePlayers()){
team.addPlayer(p);
I did like so
doesn't seem to work either
ooooh
well I can't actually set the scoreboard
since the server already has one
That's why I prefer packets soooo much.
You got no control over the code which sets this scoreboard so you can attach the team to it?
dont think so
Get the current scoreboard of the player and extend that
I think this should be an option
oooh
Scoreboard sb = p.getScoreboard();
Then add your team to that, but first null-check it. Just to make sure.
but then every player will have different team?
I thiiiiink that a player should be able to be in multiple teams...
Can't you just try that real quick?
Player#getScoreboard is @NotNull
soo no need to check for that
Alrighty, didn't display that annotation to me for whatever reasion.
for(Player p : Bukkit.getOnlinePlayers()){
Scoreboard scoreboard = p.getScoreboard();
Team team = scoreboard.registerNewTeam("no_collisions");
team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
team.addPlayer(p);
p.sendActionBar(component);
p.setCollidable(false);
}
Send pls
You need to add all online players to the team, not just that player. But I think it'll be easier to create the team upfront to not end up with two nested loops. All players need to be in a team having all players.
I don't know much about this API, sorry
Don't even know if teams are reusable
Maybe just have the two nested loops, who cares, lol
FourteenBrush cares ๐
great
Here is a bare bones example of intercepting packet I/O:
https://paste.md-5.net/unubijesum.java
Using the reflection helper I made earlier:
Yeah, that looks about right
If the Team is reusable and doesn't keep any other state, you could pick out the first player, create a team for them, then loop the rest and re-use that team on all of them.
But I don't at all know what goes on behind the scenes of this API.
nah
some other plugin is managing scoreboards
Yeah, teams aren't usable across different scoreboards, as they hold a ref to their containing board.
Wow, it get's even more messed up than that.
Double-Loop's gonna stay, xD.
:DD
I know why I don't use all of that, :-:
@dry yacht thank you so much...
Your ExecutorUtil.registerEvent idea worked as expected, gonna test your code now, thank you ๐
Ueegh
sooo I tried double loop
I can walk thru without getting pushed
but the other guy gets pushed
You could just send a PacketPlayOutScoreboardTeam to bypass all of this mess tho.
Happy to hear! :). I just try to not use any third-party dependencies for simple things. Listing classes of a jar basically means looking into that jar on the disk, that's all the magic to it. Don't even know if classes which aren't used are even loaded into the namespace, so you'd have to know their fully qualified name and call Class#forName on them initially anyways (which my function does).
So that's progress, right? Did that code execute on both players, did you make sure of that?
imma make sure of that
again
well
Hm?
Btw, this kinda suggests that you can only have one one Team per player.
I don't know if this is an artificial limitation of bukkit or if the client actually only stores one team.
for some reason this loop isn't stopping
use a consumer<bukkittask>
task -> {}
then do task.cancel(), returning wont stop it
right
Then IDK how to create Team
that can be used for everyone
without changing Scoreboard
If I could only get a quick look at a deobfuscated vanilla minecraft client... If it also cannot handle multiple teams, we could stop right here, otherwise I'd just use packets to push those teams onto all clients.
Wait, you probably can do something else tho
@twilit roost Could you please try something out real quick?
sure
change api version to 1.19.3
is there anything else or will that just work
Wait, how do I get the ID of this to cancel the task?
ig that will work
aight thx
@twilit roost
https://paste.md-5.net/ujulugakiy.js
I don't think that you actually have to be in the same team with everybody else, as rule NEVER means don't push foreign teams as well as the own team. Just check for existing teams and set the option if available or create a new "dummy team" just for that purpose.
you clearly didnt listen and just said aight
Whenever you call runTask..., you get back an integer number which is a unique task ID. Then, call BukkitScheduler#cancelTask(id)
Wasn't there some new task API which was able to #cancel itself? I totally forgot what it was named like tho...
there are two methods, one is BukkitScheduler#runTaskTimer(JavaPlugin,Runnable,long,long) and another one is BukkitScheduler#runTaskTimer(JavaPlugin,Consumer<BukkitTask>,long,long) so you must do java scheduler.runTaskTimer(plugin, task -> { // do stuff // cancel task.cancel(); return; })
lambda can just check to cancel itself
oh damn
I ran out of test dummies ( players )
will have to wait for a bit
that's exactly what I meant, great stuff! :D
Don't you have a second account? xD
I can join real quick if you tell me the version and the IP
eeegh too lazy
but imma try it ๐
yep got it
its only accesable for Czechia and Slovakia
soo your IP won't get thru
as you said, lambda
i hope you know what it is
Lambda or Method-Reference, doesn't matter. I'd rather call it Consumer.
aight
I just think that what I said should hold true, as many big servers literally have a unique team for every player due to prefix, name and suffix complexity, and they still manage to disable pushing.
As long as you're in a team which has the NEVER push option attached, you should be non-pushable and non-pushing.
soo I shouldn't add every player into that team anymore
Nope, use the code I've sent you
im using it
It should only patch what's necessary, since you're not the main handler of the scoreboard.
And?
still gets pushed
the 2nd guy
So channel read is the incoming packet or outgoing?
maybe the scoreboard plugin has an API
soo I could get Teams for all players
^
your seconds are over 60
you can print seconds before setting the progress
aight
Actually
Your seconds are probably negative
unless thereโs some part of the code that initialized seconds variable to something over 0
Could be, but I'm cancelling task when seconds = 0
so the task won't cancel unless the exception is fixed?
oh thatโs true his seconds are 300
Find all places where you set the countdown
Well the exception stops the code from running
seconds / 60.0
wait
what
wtf
ah right
let me try smth
legit the same
this is confusing
OR
Maybe the error isn't to do with this
could be this
Yup
it is
my bad, thanks y'all
wondering how Minplex did their Collisions in DeathRun
I need to disable Collisions for all Players
And also make them semi-visible
but mainly those collisions
Tried Teams, Player#setCollidable and Player#spigot#setColli..
nothing worked so far
LOL
Ofc it's that
It's your ide
Ij is supposed to tell that it won't be null
ok, so i can use without problems tho
Because i compile it, execute it and give NPE as IJ said
Create a class that does this
Agree
@sterile token are yiu saying you get a NPE?
Yikes
?
why does it immediately go to the second prompt?
You said you can use it without problems and then said it gives an NPE
I wll use:
class CooldownModel {
void cancel();
boolean hasExpired();
String getName();
long getRemaining();
}
class UserModel {
UUID getUUID();
Map<String, CooldownModel> getCooldowns();
CooldownModel getCooldown(String name);
}
// Example usage
UserModel user = this.plugin.getUsers().getUser(player.getUniqueId());
if (user == null) return;
CooldownModel cooldown = user.getCooldown("test");
if (!cooldown.hasExpired()) return;
player.sendMessage("Cooldown expired");
Obivously its written in pseudo code, just you to have an idea
lol
I use that cooldown system, that is the reason for loving POO languages!!
why exposing the map and writing a get impl for that map?
that map is suppoused to retunrn an inmutable copy!
getCooldowns() { return new HashMap<>(this.cooldowns); }
Just code like you like tho ๐
the question is how do i put structures on these
is that a c-cloud?
That looks cool
Thanks, working on structures at the moment
how in the world did you make that?
Big brain
But like i wanna know too
But like how do you get those kinda shapes
Lmfao
That's like me asking how to draw a circle and you saying use math n shit
Sure you're not wrong
But not helpful eithee
the real question is what is ServerPlayer on 1.19
oh wait
the same thing 
i think it got removed
it uses inventory listeners on 1.19 iirc
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#updateInventory() it literally exists in the javadocs of 1.19
declaration: package: org.bukkit.entity, interface: Player
Oh i see
Why tho
?
What about them?
ask @lost matrix He did that a while back
When players cure zombie villagers, how does the villager "remember" who cured them, from a Spigot standpoint? Is that accessible anywhere? I can't find it in the API for Villager, Merchant, or the nbt data for villagers, so I'm a bit baffled
hi can someone help me with placeholders
I do it like this https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/ServerUtils.java#L86
shameless plug
Lmao
I have a question, is there a way to make a certain ItemStack unstackable?
I want to create a custom item (with a nether star) but i want it to not be stackable
Give it some custom data. The simplest way is to change the item meta.
The better way is to use the PDC.
just check if Bukkit.getWorlds().size() > 0 in onLoad and you know its restarting
reloading i mean
But if i give it say a random data value won't it have a chance to still stack if it has the same value?
dunno if onLoad is called after the worlds have been loaded then
Only if you use something predictable. Timestamps are one hell of a solution as they are 100% unique. You can also use UUIDs because the chance of a duplicate is astronomically low.
utils for everything
How would i generate a UUID for the ItemStack?
UUID#randomUUID()
Yes, if you generate 1 billion uuids per second, youโll get two conflicting UUIDS in 85 years
Im still pretty new to Spigot development, how would i go about assigning the UUID to the ItemStack?
PDC!!
?pdc
lol
Aight lemme check that out
I sent some example code above
Switch to a proper ide like intelliJ
stop spooon feeding
its weird bruh, but ill try
At least it works ๐
As much as it can
As fast as your CPU will let it
As many as your cpu can handle
ram ๐
baaaaa
Pam ๐ฉ
the amount of times it will execute depends on how fast the code within executes lol
Fam ๐จโ๐ฉโ๐งโ๐ฆ
while(true) Thread.sleep(1000)
and ram and cpu lol
Femme 
What does mc do when a tick is finished ticking?
Wait
Just sleep till the next tick?
And cpus dont taste good
I think you mean spicy.
They have this weird metallic taste
So while(true) basically is gonna have cpu usage sky high right?
Well yea. It's an infinite loop.
So how do thinks like sockets wait for a connection?
If you wanna crash the server, just use Unsafe#putAddress
Do they sleep a bit and check?
my code is still not working ```package events;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
public class PlayerEats implements Listener{
@EventHandler
public void onPlayerEatP(PlayerInteractEvent playerDoingTheAction) {
Action azione = playerDoingTheAction.getAction();
Player playerThatEats = playerDoingTheAction.getPlayer();
ItemStack pork = new ItemStack(Material.GRILLED_PORK);
ItemStack foodBeingEaten;
ItemStack rowPorkchop = new ItemStack(Material.PORK);
if((azione == Action.RIGHT_CLICK_BLOCK || azione == Action.RIGHT_CLICK_AIR) && playerThatEats.getInventory().getItemInMainHand() == pork) {
double health = playerThatEats.getHealth();
playerThatEats.setHealth(health - 1);
}}}
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
yea im explaining one sec
oh oke
Thread#onSpinWait can be put in an empty loop
Why did you name the event โplayerDoingTheActionโ o0
it might yield thread too when waiting
But its an event, not a player lol
Its just wrong
am i the only one who watched codedred?
Thatโs a bit like declaring a โString ageโ
Probably not, but i try to avoid videos as much as possible
ur right, it used to help me with playerDoingTheAction.getPlayer();
still not doing what it should
Dont print out when its not double
maybe ill try with consume
Souts are extremely slow
spigot vids are shit anyways
True
how are we supposed to learn?
Here, or the forums preferably. You'll get more up to date information.
Also always cringe when you see this
// Plugin startup logic
and making stuff
look at github
my ij plug-in does that automatically
but i delete it ๐งโ๐ฆผ
Yeah i never get tired of telling how shitty that plugin is
itโs not that bad
i like it
just needs to change its maven plug-in versions ๐
It doesnt do anything besides throwing stacktraces
Why not just use maven archetypes
i donโt have that issue
Neither do I.
is there a maven archetype for spigot ??
No, there is not.
or are you able to make your own ?
You can make your own
Thank you shadow your messages give off hot person vibes
that makes sense
Thank you. 
clearly
sure, many ones
this for example, but it's a bit weird https://github.com/SyntaxCacao/spigot-archetype
I wrote my own but it's not on github yet
a maven archetype for a spigot project
mvn archetype:generate
or was it create?
i am not sure
yes i figured that out but itโs so weird
how is it weird lol
it generates an overview ?
Sorry for ping but do yk how to get the total amount out of that list?
it creates the whole basic project. main class, plugin.yml pom.xml ...
but you canโt configure anything with it
ofc you can
Simply sum the value of each entry
after you create it yeah but not during
no what
yeah ofc
it doesnโt look like you can
wtf that's the whole point of it
I will show you in a few minutes after I uploaded my archetype
So like morice said?
List<PlayerStat> toReturn = new ArrayList<>();
for (UUID uuid : getAllUuids()) {
Profile profile = ProfileManager.getProfile(uuid);
if (profile != null) {
toReturn.add(stat);
}
}
return toReturn.size();
}```
No
Each value combined
is there something like player.isConsuming? lmao sorry if im asking this stuff
yeah then it includes the shade config and dependencie stuff
right right
check out archetype-resources/pom.xml
oh wait
that's the old version
shit
where is this fucking repo
okay now
looks like this
i submitted an issue
channelRead is PacketPlayIn..., which means packets which are sent by the client to the server, while write is PacketPlayOut..., which are packets sent from the server to the client. It basically operates on the socket initiated by the client towards the server, so writing to that socket means sending to the client and reading on it means receiving by the client, if that helps at all.
Yeah, I also often get that mixed up. This is just a mnemonic to remember directions.
the mojang names make much more sense
ClientboundAddEntityPacket e.g.
it's obvious what it does, it's obviously clientbound, and it has no weird "Play" in it's name
Sure, but that wouldn't help you on a duplex channel handler which has read- and write interceptors and only Objects as arguments, :p
So it's good to know how things are initiated behind the scenes.
each value combined. Would u know how to combine it all?
Play is the packet phase
Yep, so I also think that it can be helpful to have this phase added to the name, although 90% of devs only ever get to see that phase.