#help-development

1 messages ยท Page 279 of 1

dry yacht
#

already tried to re-export after cleaning? Could be a compiler bug

frank kettle
#

is it possible with a merchant get which villager is it trading with?

gilded knot
#

I'll give that a try

dry yacht
#

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

gilded knot
#

was a compiler bug

dry yacht
#

Maybe I'm a bit lost right now, I'll just trust you.

valid basin
#

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

dry yacht
#

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.

valid basin
#

Did I do it correctly?

tender shard
#

what's Annihilation line 38?

dry yacht
#

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.

chrome beacon
dry yacht
#

Of course not, which is why I put my reflection lib to use, xD.

#

But it should have a public int

vocal mirage
#

so do you have any ideas?

eternal oxide
#

you don;t "cast" Player to ServerPlayer

#

ok

#

yep

dry yacht
#

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.

gilded knot
#

How do I get a bossBar to sync to a clock/countdown timer

crimson terrace
#

You set progress on that timer

gilded knot
#

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

remote swallow
#

you send a new message

crimson terrace
#

Youd just update all players bossbars whenever you set the time, not sure why this is a problem rn

gilded knot
#

aight

gilded knot
#

half-way the timer

crimson terrace
#

Dont have the methods in front of me but there should be a settitle method or something

gilded knot
#

My current code

#

downside is if a new player joins, they won't receive the time

#

or bossbar

crimson terrace
#

Cant you just do something similar foreach Bukkit.getonlineplayers?

gilded knot
#

I think i do

#

checking

summer scroll
#

Foreach online players will work too

gilded knot
#

yeah i do

undone axleBOT
summer scroll
#

You're creating a thread for every players online ๐Ÿ’€

remote swallow
#

love the // Handle Exception

#

e.printStackTrace() be like

gilded knot
#

yeah, thus why I'm trying to change it ๐Ÿ’€

tender shard
gilded knot
tender shard
#

tbh I havent read the code at all, I only saw "new Thread" and reccommended the bukkit scheduler

dry yacht
#

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.

quaint mantle
#

Hi! I would be interested to know how the plotMe plugin works. I rewrote the plot size and nothing changed. What could I do?

remote swallow
#

did you reload the plugin or restart?

#

that

#

i meant reload the plugin lol

quaint mantle
#

It happened but nothing changed.

remote swallow
#

it probably requires a restart

tall dragon
#

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) ?

quaint mantle
#

Yes restart happened but nothing has changed. (i don't usually press reload)

dry yacht
#

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, :(

rotund ravine
dry yacht
#

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

rotund ravine
frank kettle
#

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?

dry yacht
dry yacht
# rotund ravine remapped jar

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.

daring elm
#

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
**

undone axleBOT
daring elm
#

ok

frank kettle
#

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?

remote swallow
#

idk what that list might be fore

#

looks like its just all versions

daring elm
#

My Main is 1,19.3

#

i did the version copied from the site

remote swallow
#

are those just versions you want to allow?

#

because that is just default

daring elm
#

ohhhh

#

I think no

frank kettle
#

what version is via version on and what version is the server?

daring elm
#

Lost .-.

remote swallow
#

do you just want all version above 1.9 to join?

daring elm
#

1.8 And Higher also All versions

dry yacht
remote swallow
#

default for all 3 plugins will work

frank kettle
remote swallow
#

latest

#

lts

frank kettle
#

ah ok

remote swallow
#

long term support

#

otherwise

#

which is normally latest version

daring elm
#

and how can i this fix with the versions?

daring elm
frank kettle
#

latest via version plugin is for 1.19.3, is your server in that version too?

frank kettle
#

ah ok

remote swallow
frank kettle
#

then u need viarewind for 1.8

remote swallow
#

^^

daring elm
#

Wow its work thanks ๐Ÿ™‚

dry yacht
#

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?

remote swallow
#

did you build with the --remapped flag

dry yacht
tender shard
remote swallow
#

lol

tender shard
#

I'm gonna be so rich

remote swallow
#

you could also add rick roll auto playing at the bottom of each page

tender shard
#

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

dry yacht
remote swallow
#

?dmca moment

undone axleBOT
tender shard
dry yacht
tender shard
#

I did not say that

#

I just said, totally neutral, that this questions comes up here a lot

dry yacht
tender shard
#

I wouldn't have written that blog post if I wouldn't be trying to help people ๐Ÿ™‚

remote swallow
#

do we like Wolvereness or not like him

dry yacht
tender shard
#

sorry, maybe I phrased it wrong

#

didnt mean to be snarky or anything lol

dry yacht
tender shard
#

all good my friend

frank kettle
#

"oh no, my bad"

"nonono, its on me"

"nah mate, my bad"

"nah, you're totally good, its my fault"

tender shard
#

see everyone? this is how discussions should look like haha

frank kettle
#

what a healthy discussion

tender shard
#

no hate, just love โค๏ธ

remote swallow
tender shard
remote swallow
#

?dmca

undone axleBOT
tender shard
#

oh the bukkit dude

remote swallow
#

he filed a dmca for loads of craftbukkit code

tender shard
#

I don't have any opinion about him

dry yacht
#
[WARNING] The requested profile "remapped" could not be activated because it does not exist.

What did I mess up? D:

remote swallow
#

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

tender shard
dry yacht
tender shard
#

remapped only exists for 1.17+

dry yacht
#

Oh

#

Well, ouch.

#

I'm outta luck then, because I think the packet even changed.

remote swallow
dry yacht
#

Oooooh, these are the official remaps, huh? So only since the refactor...

tender shard
#

ther are official mappings for 1.14.1+ too but buildtools wont build them for you

remote swallow
#

if he wanted the bukkit/spigot stuff to continue or he was forced to

tender shard
#

spigot switched to mojang mappings in 1.17, before that it used their own class names and stuff

remote swallow
#

im guessing thats when mojang released their obsfucation map

tender shard
#

no that was 1.14

#

1.14.4 it seems

dry yacht
#

Are these maps accessible anywhere? I kinda need 1.13.1, :-:

remote swallow
#

my fucking god, 1.14 was 2019

remote swallow
#

or the obsfucation map was released in 2019

dry yacht
tender shard
tender shard
#

it's the best mappings viewer imho

remote swallow
#

damn

#

wait 1.17 was 2021

#

it seems so much older

#

what the fuck

#

when did 1.18 release

tender shard
#

1.17 was july 2021 IIRC

remote swallow
#

did we used to get 2 major versions a year?

#

damn

tender shard
tender shard
#

when 1.16 was released I still had a GIRLfriend

#

imagine that

remote swallow
#

arent they now changing type since 1.19.3

tender shard
#

wdym

dry yacht
remote swallow
#

they are going to release more 1.19.something versions or something like that

rotund ravine
#

Not for 1.13

#

there is mojang mappings for 1.14+

tender shard
#

before that there were no proper mappings

#

at least no official ones

dry yacht
#

Jeah, but there gotta be some "underground" mappings, like... Hundreds of people work on this stuff

tender shard
#

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

frank kettle
#

i remember trying to play with them ๐Ÿ’€

dry yacht
#

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...

tender shard
#

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+

remote swallow
#

the version i see a load of people on is 1.17

dry yacht
remote swallow
#

i see 1.16 sometimes but normally higher

#

update server lol

#

you can get a paper server online

tender shard
#

all those people on 1.16 are using some weird hybrid fork from my experience

#

magma or catserver or similar

#

or, mohist (even worse)

dry yacht
remote swallow
tender shard
#

nobody complained about "why it no works in 1.8??!?!?!?!" in years

dry yacht
remote swallow
#

i dont want to use lower than java 16 so i just will use 1.17 and higher or that

rotund ravine
#

slotcount and entityidin

dry yacht
# tender shard I always just go for 1.16+

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

dry yacht
rotund ravine
#

things are named a bit differently tho

dry yacht
tender shard
dry yacht
tender shard
#

am I stupid? but the link you sent doesn't work for me

rotund ravine
tender shard
#

oh ok

#

thx

#

yeah now it works

dry yacht
# tender shard no I mean, what are the "three lines" you are struggling with

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.

dry yacht
tender shard
#

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

dry yacht
#

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.

tender shard
#

but I'm using it on IJ ultimate

#

can you send a stacktrace?

dry yacht
#

I'm on macOS and M1 tho, that might add to the issue.

remote swallow
#

alex funnily enough is also on macos lol

dry yacht
#

I thought I saw a windows application appearance there? lol

remote swallow
#

he dual boots it i think

#

or just has 2 computers

dry yacht
#

Oh, it was macos indeed, I didn't look carefully enough at the window details.

remote swallow
#

lol

tender shard
tender shard
#

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

remote swallow
#

disable hardware acceleration

tender shard
#

well I don't need to take screenshots of netflix

dry yacht
#

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.

tender shard
#

everyone already knows the office anyway. if not, their fault

tender shard
dry yacht
tender shard
#

except for the gpu part lol

#

my mac only has integrated intel gpu ๐Ÿฅฒ

dry yacht
#

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.

gilded knot
gilded knot
#

there's a reason why developers release seperate "Intel" and "M1" chip apps seperately

tender shard
#

unfortunately they only released the 13" with m2 yet

#

but I want 16 inch

gilded knot
dry yacht
gilded knot
tender shard
dry yacht
gilded knot
tender shard
gilded knot
tender shard
gilded knot
#

and I'm chilling playing Valorant, assassins creed and hitman 2

#

lol

gilded knot
dry yacht
gilded knot
tender shard
#

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

gilded knot
#

Honestly

#

my suggestion is to just bootcamp windows

dry yacht
#

You cannot bootcamp on M1

tender shard
#

isn't bootcamp deprecated?

dry yacht
#

Only use parallels, and I have no money to buy that.

gilded knot
#

can you not? wtf??

dry yacht
#

And mac-torrent-download got killed.

gilded knot
tender shard
#

is there even a windows version for ARM?

dry yacht
#

And even then, you'd have to use ARM windows, which is a pice of shit in itself.

gilded knot
#

fair

#

I mean

#

You could get VirtualBox

#

I have ubuntu on it

remote swallow
#

fuck ubuntu

tender shard
#

yeah ubuntu is shit

gilded knot
#

bruh wow lol

remote swallow
#

it looks like an ipad from 2014

gilded knot
#

Ubuntu server*

tender shard
#

ubuntu is shit because canocical promised "we will never replace apt with snap". and then (a year later) they replaced apt with snap

gilded knot
#

such controversy ๐Ÿ˜‚

tender shard
#

also ubuntu tends to break when going across versions

#

I just always use plain old debian

gilded knot
#

fair

tender shard
#

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

tender shard
gilded knot
#

When it comes to server OS' my knowledge it limited

gilded knot
tender shard
#

13 is latest

gilded knot
tardy delta
#

big surrr

gilded knot
#

I would if I could ๐Ÿ˜‚

#

I was thinking of like

#

Force-Installing Ventura

#

but I realised what's the point

tender shard
#

yeah okay that's like 8 years now

gilded knot
#

It requires me to fresh install my computer

#

I already have so many files which I need

remote swallow
#

this is why we like windows

#

because windows.old

gilded knot
#

windows 11 sucks

remote swallow
#

ye

tender shard
remote swallow
#

windows 10 best

gilded knot
#

limited to only specific CPU types

tender shard
#

today I lay this cable

#

and now I got 2.5 gbit

gilded knot
#

10 is best, I agree

gilded knot
remote swallow
gilded knot
#

does your bandwidth even go up to 2.5gbit lol

gilded knot
tender shard
tardy delta
#

i have 100mbps lol

tender shard
#

usually it's only around 1500 mbit

#

but that's still more than enough

tardy delta
#

wtf

tender shard
#

sometimes it's even much lower

#

but yeah welcome to german internet infrastructure lol

#

over wifi (on the mac) I only get 50mbit D:

tardy delta
#

my ethernet is slow asf too

dry yacht
#

@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.

tender shard
#

PluginManager#disablePlugin(Plugin)

#

np

tender shard
#

renaming inventories?

#

I actually had a method for that in JeffLib

#

but guess what

#

I removed it because it didnt work properly ahaha

dry yacht
#

Because that huge load of items going accross the network is something I think you'd most definitely want to avoid.

tender shard
#

yeah I also used packets but I dont remember what exactly the problem was

dry yacht
#

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.

green prism
#

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);
            }
        }
    }```
sharp ridge
#

Force opening stonecutter

tender shard
#

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

humble tulip
#

Inventory should have a getId() method

#

Imo

tardy delta
#

to return what?

humble tulip
#

The internal id for the inv

green prism
green prism
humble tulip
green prism
#

How can I obtain files inside jar to saveResource them?

humble tulip
green prism
humble tulip
gilded knot
#

I know Thread.sleep isn't optimal

#

what do I use instead

humble tulip
#

?scheduling

undone axleBOT
green prism
#

Bukkit Scheduler

#

runTaskLater

humble tulip
#

What you do is run a repeating task with 20 ticks interval

gilded knot
#

ah right

humble tulip
#

Every time it runs, you can subtract 1 second

gilded knot
#

aight

humble tulip
#

Wtf ppl are buying my plugin all of a sudden

#

I didn't even advertise๐Ÿ˜‚

gilded knot
humble tulip
#

Think I'm gonna add a getID method

#

Well create a pull request

tardy delta
#

whats wrrong with creating a map of inventories?

humble tulip
#

^^

#

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

green prism
#

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;
    }```
tardy delta
#

get their package name?

green prism
#

thank you hah

lusty orbit
#

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);
        }
    }
}```
tardy delta
#

tf

remote swallow
#

you what

lusty orbit
#

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);
                }
            }
        }
    }```
narrow sphinx
#

@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

clever musk
#

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?

dry yacht
humble tulip
#

Are they though?

#

Oh wait

#

Wtf

dry yacht
humble tulip
#

I think they are

dry yacht
#

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.

dry yacht
# clever musk Is there an option I can add to my plugin.yml to prevent my plugin from loading ...

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.

green prism
#

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

dry yacht
#

Would help if you could post the whole stacktrace.

humble tulip
green prism
tardy delta
#

ig its this

green prism
#

I'm sorry, what?

#

Ohhh, you want the method, sure, hold on a second

dry yacht
#

EventCloseExecutor.java:29 yields } catch (Exception exception) {, are you sure that stacktrace is in sync with the current state of your file?

green prism
# tardy delta ig its this
    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;
    }
cobalt marlin
#

what is the DamageCause for worldborder damage?

green prism
dry yacht
#

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...

green prism
dry yacht
#

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

green prism
#

method.invoke(null, e);

#

What class am I passing?

#

second param is Args

dry yacht
#

ย 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.

white root
#

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)

tardy delta
#

2nd one ig

#

as those are inv holders

dry yacht
green prism
dry yacht
#

You have to instantiate the class somewhere, right?

green prism
#

no

#

it's all about reflection

dry yacht
#

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

green prism
#

for(Class<?> closeExecutor : annotated) {
// // = closeExecutor.newInstance();

#

I should pass that inside the map

#

and use it

dry yacht
#

Instead of passing a Class<?>, pass an Object.

green prism
#

Object instance = closeExecutor;

dry yacht
#
closeExecutor.getDeclaredConstructor().newInstance();
green prism
#

Directly?

#

Hmh

dry yacht
#

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.

green prism
#

No more reflections to do

#

finally back to java

tardy delta
#

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

dry yacht
#

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.

tardy delta
#

making a reflective pojo mapper was fun i can say

dry yacht
green prism
#

Thank you for the idea ๐Ÿ™‚

tardy delta
dry yacht
#

Oooh, a relational db object mapper?

tardy delta
#

kinda

#

i gave up cuz the creating of statement became to difficult to do with reflections

#

a simple insert works lol

dry yacht
#

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.

ionic thicket
#

why is a method like this?

ionic thicket
#

i'm using getItemInHand

remote swallow
#

its deprecated

green prism
#

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?

dry yacht
ionic thicket
#

ahhhh

#

oke

remote swallow
#

or InOffHand

ionic thicket
#

thank you

glacial shell
#

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
tardy delta
#

update server ver

glacial shell
tardy delta
#

google class formats versiosn

dry yacht
glacial shell
humble tulip
#

Do you use maven?

glacial shell
#

yes

humble tulip
#

You need to change it in your pom.xml

glacial shell
#

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

humble tulip
#

Yes

#

And still doesn't work?

green prism
# dry yacht Very good question, I don't know what library you're using. Mind showing me the ...

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;
    }```
glacial shell
#

yeah it doesnt work i changed the pom file and i change the projects java jdk

dry yacht
glacial shell
humble tulip
#

And you r pom

dry yacht
# green prism I'm using org.reflections. It would be amazing, thank you so much! ```java ...

https://github.com/BlvckBytes/BBLibDI/blob/d7c2a0287bca84abce4d8d57e7c565946687caba/src/main/java/me/blvckbytes/bblibdi/AutoConstructer.java#L107

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.

GitHub

Dependency injection library for my spigot plugins. - BBLibDI/AutoConstructer.java at d7c2a0287bca84abce4d8d57e7c565946687caba ยท BlvckBytes/BBLibDI

humble tulip
#

?paste

undone axleBOT
remote swallow
dry yacht
glacial shell
#

done

remote swallow
#

send the link

dry yacht
#

Paste the url

glacial shell
dry yacht
#

Btw, you probably use IntelliJ, right? Did you click the little maven update button?

glacial shell
#

the one that floats in the middle of the code editor place?

humble tulip
#

Yes

remote swallow
#

near the top right

glacial shell
#

yeah i clicked the floaty thing

dry yacht
#

Or this one, which is always available.

glacial shell
#

oh that no 1 sec

#

let me test it to see if anything changed

#

and i click package should i click compile instead?

humble tulip
#

Do clean install

dry yacht
#

Every lifecycle invokes all of it's above siblings.

remote swallow
#

press control twice then type mvn clean package, for future builds press the green play button near the top right

dry yacht
#

But package generally builds a jar.

glacial shell
#

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
humble tulip
#

Run clean first

#

Then package

ionic thicket
#

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

glacial shell
#

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:?]

remote swallow
#

you have more than 3 characters for a recipe

dry yacht
#

That's not java-version-related then, I guess.

remote swallow
#

?paste the class

undone axleBOT
glacial shell
#

i think i just put 1 too many spaces

ionic thicket
remote swallow
remote swallow
ionic thicket
#

i dont get damage when i eat porkchop

#

whein i right click on air or on a block with porkchop in my main hand

twilit roost
#

How can I make players not push each other?
Player#setCollidable nor Player#spigot#setCollidableWithEntities
doesn't work

remote swallow
glacial shell
#

thx for all yalls help it works now ๐Ÿ˜„

remote swallow
dry yacht
remote swallow
#

^^

ionic thicket
#

oke thank you guys

rotund ravine
#

It's fine tbh.

dry yacht
twilit roost
#
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

dry yacht
#

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?

twilit roost
#

dont think so

dry yacht
#

Get the current scoreboard of the player and extend that

#

I think this should be an option

twilit roost
#

oooh

dry yacht
#

Scoreboard sb = p.getScoreboard();

#

Then add your team to that, but first null-check it. Just to make sure.

twilit roost
#

but then every player will have different team?

dry yacht
#

I thiiiiink that a player should be able to be in multiple teams...

#

Can't you just try that real quick?

twilit roost
#

Player#getScoreboard is @NotNull
soo no need to check for that

dry yacht
#

Alrighty, didn't display that annotation to me for whatever reasion.

twilit roost
#
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);
}
humble tulip
#

Anyone got an example of how to interceot packets with netty.io?

humble tulip
#

Send pls

dry yacht
twilit roost
#

oooh damn

#

but i cant create team
without scoreboard

dry yacht
#

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

twilit roost
#

FourteenBrush cares ๐Ÿ˜„

dry yacht
#

I care too, but I hate the API

#

So you're on your own on that one, lol

twilit roost
#

great

dry yacht
twilit roost
#

imma try it like so

#

fax

dry yacht
twilit roost
#

are teams persistent?

#

or shall I somehow destroy them

dry yacht
#

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.

humble tulip
#

Are you the only one managing scoreboards on the server

#

As in tje only plugin?

twilit roost
dry yacht
#

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.

twilit roost
#

:DD

dry yacht
#

I know why I don't use all of that, :-:

green prism
#

@dry yacht thank you so much...
Your ExecutorUtil.registerEvent idea worked as expected, gonna test your code now, thank you ๐Ÿ™‚

twilit roost
#

Ueegh
sooo I tried double loop

I can walk thru without getting pushed
but the other guy gets pushed

dry yacht
dry yacht
# green prism <@697274381587447899> thank you so much... Your ExecutorUtil.registerEvent idea ...

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).

dry yacht
twilit roost
#

imma make sure of that
again

dry yacht
#

Just debug log within the outer loop

#

the target's name

twilit roost
dry yacht
#

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.

gilded knot
#

for some reason this loop isn't stopping

tardy delta
#

use a consumer<bukkittask>

#

task -> {}

#

then do task.cancel(), returning wont stop it

gilded knot
#

right

twilit roost
#

without changing Scoreboard

dry yacht
#

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.

dry yacht
tranquil stump
#

how do i update my plugin to for 1.19.3

#

my plugin is set up using maven

dry yacht
#

@twilit roost Could you please try something out real quick?

twilit roost
#

sure

tardy delta
tranquil stump
#

is there anything else or will that just work

gilded knot
#

Wait, how do I get the ID of this to cancel the task?

tardy delta
#

ig that will work

tranquil stump
#

aight thx

dry yacht
#

@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.

tardy delta
gilded knot
#

I looked into it

#

but im still confused

dry yacht
#

Wasn't there some new task API which was able to #cancel itself? I totally forgot what it was named like tho...

tardy delta
#

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; })

gilded knot
#

ohh you need another new method

#

right

tardy delta
#

lambda can just check to cancel itself

twilit roost
dry yacht
dry yacht
#

I can join real quick if you tell me the version and the IP

twilit roost
#

eeegh too lazy
but imma try it ๐Ÿ˜„

gilded knot
#

yep got it

twilit roost
gilded knot
#

as you said, lambda

tardy delta
#

i hope you know what it is

gilded knot
#

mhm, definitely.

#

yup, expert

dry yacht
gilded knot
#

aight

dry yacht
#

As long as you're in a team which has the NEVER push option attached, you should be non-pushable and non-pushing.

twilit roost
#

soo I shouldn't add every player into that team anymore

dry yacht
#

Nope, use the code I've sent you

twilit roost
#

im using it

dry yacht
#

It should only patch what's necessary, since you're not the main handler of the scoreboard.

dry yacht
twilit roost
#

still gets pushed
the 2nd guy

humble tulip
twilit roost
#

maybe the scoreboard plugin has an API
soo I could get Teams for all players

gilded knot
#

task isn't cancelling ๐Ÿค”

humble tulip
#

Cuz there's an exception

#

Seconds / 60 is giving 5

#

So seconds is 300

gilded knot
#

wtf

#

how?

humble tulip
#

Print seconds

#

Idk

gilded knot
zealous scroll
gilded knot
#

but why o_o

zealous scroll
#

you can print seconds before setting the progress

gilded knot
#

aight

zealous scroll
#

Actually

#

Your seconds are probably negative

#

unless thereโ€™s some part of the code that initialized seconds variable to something over 0

gilded knot
#

Could be, but I'm cancelling task when seconds = 0

humble tulip
#

The exception says 6.0

#

5.0*

#

So it's over

gilded knot
#

so the task won't cancel unless the exception is fixed?

zealous scroll
#

oh thatโ€™s true his seconds are 300

humble tulip
#

Find all places where you set the countdown

humble tulip
gilded knot
#

doing that now

tardy delta
#

seconds / 60.0

gilded knot
#

wait

#

what

#

wtf

#

ah right

#

let me try smth

#

legit the same

#

this is confusing

#

OR

gilded knot
#

could be this

#

Yup

#

it is

#

my bad, thanks y'all

twilit roost
#

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

sterile token
#

๐Ÿคก

#

Nothing to say, its simple, JAVA being JAVA ๐Ÿ’€

humble tulip
#

LOL

sterile token
#

Yeah

#

Its amazing haha

humble tulip
humble tulip
#

Ij is supposed to tell that it won't be null

sterile token
#

ok, so i can use without problems tho

#

Because i compile it, execute it and give NPE as IJ said

humble tulip
sterile token
#

Agree

humble tulip
#

@sterile token are yiu saying you get a NPE?

humble tulip
#

?

tranquil stump
#

why does it immediately go to the second prompt?

humble tulip
#

You said you can use it without problems and then said it gives an NPE

sterile token
#

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

tardy delta
#

lol

sterile token
#

I use that cooldown system, that is the reason for loving POO languages!!

tardy delta
#

why exposing the map and writing a get impl for that map?

sterile token
#
getCooldowns() { return new HashMap<>(this.cooldowns); }
tardy delta
#

thats not immutable

#

thats just a copy

sterile token
#

Just code like you like tho ๐Ÿ˜‚

opal juniper
#

the question is how do i put structures on these

tardy delta
#

is that a c-cloud?

quiet ice
#

That looks cool

opal juniper
#

Thanks, working on structures at the moment

vapid grove
humble tulip
#

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

opal juniper
#

the real question is what is ServerPlayer on 1.19

#

oh wait

#

the same thing OMEGALUL

#

i think it got removed

#

it uses inventory listeners on 1.19 iirc

echo basalt
#

yes

rotund ravine
#

Oh i see

#

Why tho

sullen marlin
#

?

rotund ravine
#

What about them?

eternal oxide
#

ask @lost matrix He did that a while back

cinder karma
#

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

young belfry
#

hi can someone help me with placeholders

tender shard
tender shard
subtle folio
#

shameless plug

humble tulip
#

Lmao

spiral juniper
#

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

kind hatch
#

The better way is to use the PDC.

tardy delta
#

just check if Bukkit.getWorlds().size() > 0 in onLoad and you know its restarting

#

reloading i mean

spiral juniper
tardy delta
#

dunno if onLoad is called after the worlds have been loaded then

kind hatch
tender shard
# spiral juniper I have a question, is there a way to make a certain ItemStack unstackable?
GitHub

Avoid writing the same code over and over again - use JeffLib for your Spigot plugins! - JeffLib/ItemStackUtils.java at 1e40083bcd0df80ae85d9ef48d49d53dce252f15 ยท JEFF-Media-GbR/JeffLib

tardy delta
#

utils for everything

spiral juniper
#

How would i generate a UUID for the ItemStack?

kind hatch
#

UUID#randomUUID()

tender shard
spiral juniper
#

Im still pretty new to Spigot development, how would i go about assigning the UUID to the ItemStack?

subtle folio
#

PDC!!

kind hatch
#

^

#

?pdc

subtle folio
#

?pdc

subtle folio
#

lol

spiral juniper
#

Aight lemme check that out

tender shard
subtle folio
#

stop spooon feeding

ionic thicket
tender shard
subtle folio
#

i like coding in wordpad tbh

#

Or libreOffice

humble tulip
#

As much as it can

kind hatch
#

As fast as your CPU will let it

tender shard
#

As many as your cpu can handle

tardy delta
#

smells like optimisation of minecraft

#

one thread

subtle folio
#

ram ๐Ÿ

humble tulip
#

baaaaa

tender shard
tardy delta
#

the amount of times it will execute depends on how fast the code within executes lol

subtle folio
tender shard
#

while(true) Thread.sleep(1000)

tardy delta
#

and ram and cpu lol

humble tulip
#

What does mc do when a tick is finished ticking?

tender shard
#

Wait

humble tulip
#

Just sleep till the next tick?

tardy delta
#

yes

#

otherwise it will eat the cpu

#

it already does but whatever

tender shard
tardy delta
#

yah

#

salty

#

eqpecially when powered on

kind hatch
#

I think you mean spicy.

tender shard
#

They have this weird metallic taste

humble tulip
#

So while(true) basically is gonna have cpu usage sky high right?

kind hatch
humble tulip
#

So how do thinks like sockets wait for a connection?

tender shard
#

If you wanna crash the server, just use Unsafe#putAddress

humble tulip
#

Do they sleep a bit and check?

ionic thicket
#

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);
        }}}
undone axleBOT
#

"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.

ionic thicket
#

yea im explaining one sec

humble tulip
#

Don't use == to compare itemstacks

#

Use itemstack.equals(otherItemstack)

ionic thicket
#

oh oke

tardy delta
#

Thread#onSpinWait can be put in an empty loop

tender shard
#

Why did you name the event โ€žplayerDoingTheActionโ€œ o0

tardy delta
#

it might yield thread too when waiting

tender shard
#

But its an event, not a player lol

ionic thicket
#

i actually watched a tutorial but yea xd

#

its easier

tender shard
tardy delta
#

am i the only one who watched codedred?

tender shard
#

Thatโ€˜s a bit like declaring a โ€žString ageโ€œ

undone axleBOT
tender shard
ionic thicket
ionic thicket
tender shard
#

Dont print out when its not double

ionic thicket
#

maybe ill try with consume

tender shard
#

Souts are extremely slow

tardy delta
tender shard
ionic thicket
#

how are we supposed to learn?

subtle folio
#

reading wikis and documentationโ€™s

kind hatch
tender shard
#

Also always cringe when you see this
// Plugin startup logic

subtle folio
#

and making stuff

tardy delta
#

look at github

subtle folio
#

but i delete it ๐Ÿง‘โ€๐Ÿฆผ

tender shard
subtle folio
#

itโ€™s not that bad

#

i like it

#

just needs to change its maven plug-in versions ๐Ÿ˜†

tender shard
#

It doesnt do anything besides throwing stacktraces

subtle folio
#

yeah

#

wait no

tender shard
#

Why not just use maven archetypes

subtle folio
#

i donโ€™t have that issue

kind hatch
#

Neither do I.

subtle folio
#

is there a maven archetype for spigot ??

kind hatch
#

No, there is not.

subtle folio
#

or are you able to make your own ?

chrome beacon
#

You can make your own

subtle folio
#

Thank you shadow your messages give off hot person vibes

subtle folio
kind hatch
#

Thank you. uwu

humble tulip
#

What's wrong with the spigot plugin

#

I like it

subtle folio
#

me to

#

alex is just being weird

kind hatch
#

me three

#

Alex has skill issues.

subtle folio
#

clearly

tender shard
subtle folio
#

biggest library to ever exist

#

bigger than his mother

#

oh hi alex

tender shard
#

I wrote my own but it's not on github yet

subtle folio
#

me when the when

#

wtf is this

tender shard
#

a maven archetype for a spigot project

#

mvn archetype:generate

#

or was it create?

#

i am not sure

subtle folio
#

yes i figured that out but itโ€™s so weird

tender shard
#

how is it weird lol

subtle folio
#

it generates an overview ?

valid basin
tender shard
subtle folio
tender shard
#

ofc you can

chrome beacon
tender shard
#

lol

#

lemme upload my archetype quickly

subtle folio
#

after you create it yeah but not during

tender shard
#

yikes

subtle folio
#

no what

tender shard
#

yeah ofc

subtle folio
#

it doesnโ€™t look like you can

tender shard
#

wtf that's the whole point of it

#

I will show you in a few minutes after I uploaded my archetype

subtle folio
#

huh

#

okay lol

valid basin
# chrome beacon Simply sum the value of each entry

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();
    }```
chrome beacon
#

Each value combined

tender shard
subtle folio
#

useJefflib

#

lmao

ionic thicket
#

is there something like player.isConsuming? lmao sorry if im asking this stuff

tender shard
tender shard
subtle folio
#

right right

tender shard
#

check out archetype-resources/pom.xml

#

oh wait

#

that's the old version

#

shit

#

where is this fucking repo

#

okay now

#

looks like this

subtle folio
dry yacht
# humble tulip So channel read is the incoming packet or outgoing?

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.

humble tulip
#

Just making sure

#

Ty ๐Ÿ™‚

dry yacht
#

Yeah, I also often get that mixed up. This is just a mnemonic to remember directions.

tender shard
#

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

dry yacht
#

So it's good to know how things are initiated behind the scenes.

valid basin
#

each value combined. Would u know how to combine it all?

dry yacht
tender shard
#

but that's already in the package name

#

I mean according to that logic, it shouldnt be called Player but rather EntityPlayer

#

or sum() it

valid basin
#

There's PlayerStat.KILLS. I want to combine all kills from

#

I was googling how to do it on stack overflow but nobody gave exact answer