#help-development

1 messages · Page 770 of 1

heavy mural
#

By that you mean delay it through the setInterPolationDelay, by highering the value?

rotund ravine
#

Some javacord thing

kindred gull
rotund ravine
#

Idk, too lazy to look into it. DSeems to want a DelegateFactotyDelegate implementation

#

Also do note

#

Running javacord in onEnable and not async might be a bad idea

hollow oxide
#

i want to make a click listener and got this

import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.Bukkit;

public class ClickListener implements Listener {

    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent event) {
        Action action = event.getAction();
        String playerName = event.getPlayer().getName();
        if (action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK)) {
            Bukkit.broadcastMessage("Le joueur " + playerName + " a effectué un clic gauche.");
        }
        else if (action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK) {
            Bukkit.broadcastMessage("Le joueur " + playerName + " a effectué un clic droit.");
        }
    }

and it's working on everything but mobs (and i want it to works on mob)

rotund ravine
#

It’s another event when you interact with entities

#

Also please compare enums properly

#

And not by their string name

hollow oxide
heavy mural
#

Would I have to delay it by using a scheduler? 🤔

hollow oxide
# rotund ravine It’s another event when you interact with entities

got this too but not my code and idk how to make it works for left click

    @EventHandler
    public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
        Player player = event.getPlayer();
        Entity entity = event.getRightClicked();
        Bukkit.broadcastMessage("Le joueur " + player + " a fait"+ event.getEventName())
        if (entity != null) {
            player.sendMessage("Clic gauche sur une entité !");
        }
    }
}
rotund ravine
#

?jd-s

undone axleBOT
rotund ravine
#

Look it up here

heavy mural
#

May anyone else take a look please?

young knoll
#

Idk exactly why but display entities just won’t interpolate the same tick they are spawned

dry hazel
#

my guess is that it uses SPI to discover something and that doesn't play nicely with relocation

dry hazel
slender elbow
#

mfw DelegateFactoryDelegate

dry hazel
#

d4j is love

slender elbow
#

true

heavy mural
#

it scales up from the corner to the entire size, but I wanted it to scale up from the middle towards both sides

somber scarab
#

I wanted to ask what is the most optimal way to store messages in my plugin?

I found it is very hard to keep track of all the cases where I need to send a message to a player or a list opf players or the whole serveror just the admins and each group has thier own messages that i will need and it just gets very messy

#

what's an efficient and clear way of storing messages

rotund ravine
#

There’s many ways

somber scarab
umbral ridge
#

how do you retrieve permission for specific command in plugin.yml?

#

Do I have to loop through the commands list and do something there?

somber scarab
umbral ridge
somber scarab
umbral ridge
#

Can I retrieve this permission string from plugin.yml for specific command? eg.:

brittle vapor
#

I believe you will need to write your own handling for that, if you are trying to check the required permission for a command

wet breach
somber scarab
somber scarab
#

and also need to dynamically add in the plugin prefix and the players' names

brittle vapor
#

"you are missing permissions <permission>" type thing?

umbral ridge
#

I'll just try to load plugin.yml as a config I guess?

#

if possible

wet breach
umbral ridge
#

I want to have a command that retrieves permission string part from plugin.yml for that command

brittle vapor
#

You can have your command handling check if user has the required permission of the command being run, then return a message with the permission. But it all depends on how you handle your commands

wet breach
wet breach
#

its a type of standard that allows messages to be swapped out easily for translating purposes. So you would have one file per language etc

brittle vapor
#

Sadly I cannot verify so I can't send screenshots

somber scarab
#

the plugin comes default as english, anyone can edit the messages as they wish

umbral ridge
#

I think thats also the easiest way

somber scarab
#

I believe ill save them in a config file then retrieve the one I need whenever

brittle vapor
#

Yeah... idk if thats the best way though

#

You need to spend time in writing a proper subcommand/command handling system

somber scarab
#

but How do I replace the %PLAYERNAME%, %SENDERNAME% and so on?

#

i guess ill reseach that

brittle vapor
umbral ridge
#

xD

brittle vapor
brittle vapor
wet breach
#

well instead of editing the messages directly, they would just provide a yml file with the language of their choice named appropriately with the two letter language identifier, then its a matter of them selecting the language they want by inputting it in the config, and then your plugin just searches for appropriate yaml file. If it can't find it, it can notify and default back to whatever is default. Same goes if any messages are missing

#

essentially all the yaml file structures would be identical, the only difference is which yaml file you are using

umbral ridge
wet breach
#

this allows you over time to provide translations as well as users to provide their own

umbral ridge
#

Simple as that xD

heavy mural
#

Is there a way in spigot to add some kind of information to an item_display entity in order to be able to remove that specific kind of item_display and not regular item_displays?

somber scarab
#

that sounds like a good way to go

wet breach
umbral ridge
brittle vapor
umbral ridge
#

I dont need any more help, I asked how to retrieve permission string part from plugin.yml and you're asking me about my command handling duke

lost matrix
#

What even is a MinecraftScreenshot

#

You cant do that async obvsly

#

Because the world could change while the ray marches in another thread.
This would completely scramble the consistency

brittle vapor
lost matrix
#

Sure

brittle vapor
lost matrix
#
Chunk chunk = ...;
ChunkSnapshot snapshot = chunk.getSnapshot();
#

What size is your image?

#

Because this could take a few minutes to render

pseudo hazel
lost matrix
#

Ok a few hours in this case

#

Ah you are not doing any material calculations and dont have any light sources

#

But interesting idea to calculate a server side view of the player

shadow night
#

A what

#

So the server can spy on the client or what

#

Hmm

#

That's a simple client mod

#

Well, no

#

Both sided

#

Yeah

#

Packets are ass

thin iris
#

wait u can take a screenshot via spigot??

#

can i see the output

#

is MinecraftScreenshot something you made

#

will it be open source 👁️ id love to try it

rotund ravine
#

It’s not a real real screenshot, but more of a representation of what they should be seeing

river oracle
#

that's probably a better idea since you can process ChunkSnapshots asynchronously too

thin iris
rotund ravine
#

ml?

thin iris
#

machine learning

river oracle
#

the first interesting CMarco plugin

rotund ravine
#

So how does the bible correlate to this

river oracle
#

😈 hey marco if there is any plugin to make premium it'd be this one

#

screenshots you can then displayon maps etc would be a wild idea

thin iris
#

what

#

u have the picture

#

just put it on a map

river oracle
hushed spindle
#

its not possible for plugins to access screenshots right

#

unless you upload the screenshot somewhere first

hushed spindle
#

but at that point you might as well just use imagemaps or smtn

river oracle
#

oh my you guys he is just doing lots of fucking math

hushed spindle
#

oh i see

#

that sounds like hell

thin iris
#

im a bit confused.. you write it as a png then save it in the data folder, so why cant you just access it lol?

rotund ravine
#

It’s missing the usual bible flair. I am dissappointed

thin iris
#

and put it on a map

#

oh..

#

i thought u meant a physical mc map

#

maps are easy

hushed spindle
#

when using multiple maps you could but you might as well let another map plugin do that

#

so if im getting this right you're basically constructing a screenshot, brother

#

insane, but very cool when pulled off

#

will the blocks themselves have textures or will you be doing solid colors for them

rotund ravine
#

He wants to have textures, but he’s lazy 100%

sterile breach
#

Hey, how to get commandmap/list of all commands in the server?

undone axleBOT
hushed spindle
#

might as well create a little rendering engine that constructs the minecraft blocks the player can see and make a literal screenshot with that with like lighting and stuff

#

unless thats what you're doing

umbral ridge
rotund ravine
#

Yes

quaint mantle
#

Hardcode is the case

#

;)

rotund ravine
#

Try and see if it was ever implemented 🤷🏽‍♂️ Else time to cry over an enumset with transparent shit ahaha

slender elbow
#

Contributions welcome

#

be the change you want to see in the world

rotund ravine
#

I mean it has an implementation of sort

#

?stash

undone axleBOT
worldly ingot
#

You can borrow it, it's okay

slender elbow
#

i own the copyright

worldly ingot
#

oh

#

okay

slender elbow
#

i mean sure, the point is that it

does not have an implementation which is well linked to the underlying server
which is why it says contributions welcome

worldly ingot
slender elbow
#

im gonna

#

yeet

rotund ravine
#

@slender elbow I expect to see you implement it within a week

worldly ingot
#

Even ItemType doesn't move that method over

rotund ravine
#

Does not block light lol

#

Idk man

#

@worldly ingot ?

slender elbow
#

he is in fear

worldly ingot
#

I mean yeah probably. That's what the docs say lol

shadow night
#

How often do servers have a gpu

opal carbon
#

oh no

shadow night
#

You could make a server player with cmarcos thingy

rotund ravine
#

Ye

worldly ingot
#

Glass blocks also don't have to be transparent

#

It's a texture

quaint mantle
worldly ingot
#

According to the server however, they allow light to pass through, which is transparency

#

I know, which is what Material#isTransparent() is doing

#

Remember that Bukkit is a server API

remote swallow
#

what

#

no way

shadow night
slender elbow
#

im gonna put bukkit-1.20.2-R0.1-SNAPSHOT.jar in my fabric folder

rotund ravine
#

Do it

hasty prawn
#

im sure that'll go well

worldly ingot
#

I dunno what to tell you. The implementation is correct

#

Not great, but it's accurate

shadow night
#

Cpu rendering is crazeey

#

How often do servers have opengl

quaint mantle
#

cpu is not for graphics

shadow night
#

Works tho

rotund ravine
#

I wonder where this is from

#

Does fences

#

Not?

#

Did it include potato

ancient plank
#

I have my own utility tag class with these

rotund ravine
#

?jd-s

undone axleBOT
ancient plank
#

But I use

private static final Set<Material> ALL_GLASS = EnumSet.copyOf(Arrays.stream(Material.values())
            .map(Enum::name)
            .filter(mat -> {
                return mat.endsWith("_GLASS") || mat.endsWith("_GLASS_PANE");
            })
            .map(Material::matchMaterial)
            .collect(Collectors.toSet()));
remote swallow
#

dont we have a tag

rotund ravine
#

Just checked

#

🥲

ancient plank
#

Minecraft tags are very limited

lost matrix
#
private static final Set<Material> ALL_GLASS = EnumSet.copyOf(Arrays.stream(Material.values())
            .filter(mat -> mat.toString().contains("_GLASS"))
            .collect(Collectors.toSet()));

Shouldnt that be enough?

ancient plank
#

They only really exist when Mojang has need for them in vanilla, and even then idk when they need em cus the things you'd think would have tags don't

#

Ye it should

#

I was too lazy to change the endswith

#

I yoinked it from this channel

lost matrix
#

What about Material.GLASS thats also kinda left out

ancient plank
#

Painge

#

Now I really have to get out of bed

#

It's so cold though :(

lost matrix
#

For some reason i got 15°C and sunshine... In November.

ancient plank
#

It's fricken 45° out in florida

#

In november

rotund ravine
#

Imagine using fahrenheit without telling us

ancient plank
#

North Florida*

hasty prawn
ancient plank
quaint mantle
#

Happy summer 🗣️

ancient plank
#

I'm also sore as Frick because I moved my queen mattress by myself twice yesterday

rotund ravine
#

Weak

ancient plank
#

Once to try something new, the second time in the middle of the night to put it into it's normal position

rotund ravine
#

Move it twice again in two days and repeat every two days

rotund ravine
#

Until u can move it whilst sleeping

hasty prawn
#

That would be pretty impressive

lost matrix
#

Buffelemphii

river oracle
#

@ancient plank omg you're back

remote swallow
#

ive gone from struggling for coal to having more coal than ill ever need again and not having enough oil

#

y2k im tearing ur house down and mining oil

young knoll
#

Oh factorio

#

One of the weirdest drugs

river oracle
#

@young knoll do you know what I did today

remote swallow
#

idk how im even gonna find more oil bc ive already had radars scanning my local area

remote swallow
river oracle
#

no even better

rotund ravine
#

Just invade the nearest country epic

#

Lead by realworld examples

river oracle
#

resolved all of Marvin's Comments yk what that means right

#

Inventory Improvement PR on top again

remote swallow
#

but no one else has power so i cant go and rob their oil without taking power with my train

#

i didnt even realise this was help dev

river oracle
#

help dev has been general since last night

#

no one has asked any questions

rotund ravine
#

There has been a fee

#

Few

river oracle
#

guh time to study for midterms

remote swallow
#

but you could factorio

#

school is 2nd priority

river oracle
#

don't have the game yet

remote swallow
#

just make way more power than you currently need

river oracle
remote swallow
#

ratio

river oracle
#

I have a commission to work on too

remote swallow
#

what is it

river oracle
#

Generator plugin with sum plugin hooks!

shadow night
river oracle
#

extra optimized :3

remote swallow
#

power gen or item gen

hasty prawn
#

your priorities are wrong

factorio > commission > > > > > > > > school

river oracle
remote swallow
#

ah

#

sus

quaint mantle
#

Colleges gets advantage of people who dependent.

remote swallow
#

how many monies do you get for the comission

river oracle
#

probably more than 150 tho

remote swallow
#

shake a my head

river oracle
#

considering I have to basically make TileEntities 😭

remote swallow
#

no you dont

#

just have a block that has a interact data

river oracle
#

yes... nvm its epic I won't bother

river oracle
remote swallow
#

just make it super laggy

river oracle
#

if the chunk is loaded I have to tick it

#

if its unloaded I don't

rotund ravine
#

That’s quite cold

remote swallow
#

NEGATIVE 900 C??!?!?

rotund ravine
#

I believe you have broken some laws of physics

remote swallow
#

anyway good bye nerds

#

im going outside

rotund ravine
desert tinsel
#

is there any way to set item frame's content just for a specific player?

#

what packets?

rotund ravine
#

?protocol

#

Well that sucks

#

Probably some entity data packet

desert tinsel
#

so with protocollib?

echo basalt
#

It's the entity metadata

#

Index 7 iirc

river oracle
#

the fact you remember that is crazy

alpine urchin
#

still advisable to check wiki

#

and the history for the version you’re dealing with

#

cause i remember i had a long issue with someone where they reported issues but the actual issue is the index changed

#

by 1

#

over the versions

#

and thats the reason why it didnt work

young knoll
#

I'm sorry what is going on here

desert tinsel
#

so confusing =)(

young knoll
#

Why is OJ simpson banning me from a thermostat for leaking government documents while I sit in a room that is colder than the laws of physics

rotund ravine
kind coral
#

hello everyone, i am trying to make a custom block plugin with rewards etc, its currently published on spigot etc. but i want to add WorldGuard support, i have tried visiting EngineHub discord but to be honest its pretty dead and their approach hasn't worked out for me

I currently have a custom flag called epicblocks-break which defaults to false and have a check that does this

public boolean canBreak(org.bukkit.Location bukkitLocation, Player player) {
            Location location = BukkitAdapter.adapt(bukkitLocation);
            World world = BukkitAdapter.adapt(bukkitLocation.getWorld());
            LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(player);

            boolean canBypass = WorldGuard.getInstance().getPlatform().getSessionManager().hasBypass(localPlayer, world);
            if (canBypass) {
                player.sendRichMessage("<red>can bypass");
                return true;
            }

            RegionContainer regionContainer = WorldGuard.getInstance().getPlatform().getRegionContainer();
            RegionQuery regionQuery = regionContainer.createQuery();

            return regionQuery.testState(location, localPlayer, STATIC_PLUGIN.getEpicBlocksFlag());
        }

The only problem is that this flag to work also needs the block-break allow flag and i need to cancel each event that doesn't match a custom block, sadly my tries have indeed failed and can't seem to get this to working AS EXPECTED, in my various implementations i got players to break custom blocks but couldn't break any other blocks in regions that didn't even have the flag to allow, tho they were inside a bigger region with it as allowed. can anyone help me?

#

this is whats in my BlockBreakEvent listener

Optional<PlacedBlock> placedBlockOptional = epicBlocks.getPlacedBlockManager().get(blockLocation);
        boolean isCustomBlock = placedBlockOptional.isPresent();

        if (epicBlocks.isWorldGuardHook() && !WorldGuardUtil.canBreak(blockLocation, player)) {
            if (isCustomBlock) blockBreakEvent.setCancelled(true);
            return;
        }

        if (placedBlockOptional.isEmpty()) return;
        PlacedBlock placedBlock = placedBlockOptional.get();

        if (!placedBlock.getCustomBlock().testRequirements(player, player.getInventory().getItemInMainHand()) && !player.hasPermission("epicblocks.bypass")) {
            blockBreakEvent.setCancelled(true);
            return;
        }
rotund ravine
#

I mean if the people who made the shit can’t help you👀 Don’t you think you are doing smth wrong

kind coral
#

i indeed tried their implementation but sadly it doesn't match the requirement i need

desert tinsel
#

what should I use here?

kind coral
heavy mural
desert tinsel
#

I solved it,

#

thx

alpine urchin
kindred sentinel
#

How to change player skin?

river oracle
meager wolf
#

Is there anything to specifically lock an item into players inventory ? So u can throw it, store it, craft with it, and doesnt drop when u die ?

river oracle
#

https://blog.jeff-media.com/creating-custom-heads-in-spigot-1-18-1/ @kindred sentinel this example is how to do it on player heads however the same applies for players yo ucna get their player profile using Player#getPlayerProfile() iirc

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

desert tinsel
#

What is the problem?
Caused by: java.lang.IllegalArgumentException: Cannot get data for not block ITEM_FRAME
this is the line: java p.getLocation().getBlock().setType(Material.ITEM_FRAME);

#

actually an item frame is not a block

umbral ridge
#

hey

slender elbow
#

indeed

umbral ridge
#

what are the chances of concurrent yaml config modification??

#

does it happens when config is modified in the same tick multiple times? or how does that work

river oracle
#

that error should never occur unless you are wildly misusing configuration files

umbral ridge
#

then why does exception for it exists? because it should never occur?

river oracle
#

because it could occur if someone is doing something dumb

wet breach
river oracle
#

exceptions are in place for unexpected behavior not expected behavior

wet breach
#

that exception isn't specific to yaml files

umbral ridge
wet breach
#

that exception is thrown when something is modified conurrently that isn't supposed to be

umbral ridge
#

My question was how does it happen? If file is modified in the same millisecond? tick? How does that happen in Yaml?

river oracle
#

or more accurate concurrent modification

#

you really shouldn't need to worry about it as long as you don't well conccurently modify your configurations

wet breach
#

if you want to concurrently modify a yaml config there is two ways, you can modify the yaml config data in memory since yaml file contents are stored in memory, or you can create a memory mapped file object

#

however, snakeyaml does not support concurrently modification if I recall, so you may have to either modify this or use some other yaml library that would support such a thing

umbral ridge
river oracle
slender elbow
#

it isn't really to do with modifying a file, usually it's because you're misusing a collection (adding/removing items from a list/map/set etc while iterating it), but it could be anything, would need to see the stacktrace to see exactly what's throwing that

river oracle
wet breach
river oracle
#

YAML is definitely far from a good storage format

wet breach
#

well it is a storage format, not sure what you mean it is far from it when it already does this

#

yaml is a super set of json

umbral ridge
#

When dealing with a larger amount of players and player data, is it still ok to use yaml? json/gson? or is sql server the best option?

river oracle
#

if you are doing data driven development YAML and JSON definitely have their uses their, but as an actual database its not ideal

wet breach
#

never said it was the best, just that it does meet the criteria in terms of flat file DB's lol

river oracle
wet breach
#

you can easily store 1GB of data in yaml just fine

umbral ridge
#

Ok thanks :D

wet breach
#

but to do so you need to memory map it

#

however, if for some reason your data is getting this large and you insist on not using a normal DB

#

you could go with binary storage

#

that is mempory mapped

#

this is efficient enough if you do it right, that you can technically store 20million blocks of data and save it in 3 seconds and load it in 6

river oracle
wet breach
#

probably can do this faster since the numbers I have are about 6-7 years old from a test that was conducted

wet breach
river oracle
wet breach
#

it can be, but it is no more efficient then what I described with binary storage

rough drift
#

I need to store a block in a list, I tried storing both a Set<Location> and a Set<Vector> (using the block's int x y z) but it doesn't really seem to work, anyone got ideas?

rough drift
wet breach
#

and save it as a string list instead

rough drift
#

It's not persistent so idgaf if it gets removed lol

rough drift
wet breach
rough drift
#

It needs to be stored for a lifetime, it's not persistent across restarts*

wet breach
#

for a lifetime?

#

o.O

rough drift
#

oh

#

wrong again

#

Like lifetime of a certain event, not forever 💀

river oracle
#

what's wrong with using a Location or int array

wet breach
#

ok, but why does it need to be stored then? Couldn't you just like keep it in memory?

rough drift
#

yeah storing it in a list

#

in memory

#

it's still storing

wet breach
#

List<Block> doesn't work?

rough drift
#

oh shit

#

I forgor that

rough drift
river oracle
#

why

rough drift
#

no clue

river oracle
#

oh yeah locations are weird

wet breach
#

wonder if this would have worked List<Integer[][][]> 🤔

rough drift
#

no

#

I am not doing that

#

also

#

I don't think that'd be memory efficient

river oracle
wet breach
#

a 3d array allows each dimension to not have to be right next to each other in memory

river oracle
#

How

wet breach
#

where as a single dimension array it does

rough drift
#

that's only in languages which don't optimize 2D arrays

#

langs like C# use a 1D array and do the math under the hood for [x][y]

inner mulch
#

Hello, how can i use my own plugins classes in another plugin, like an api?

wet breach
rough drift
young knoll
#

ddfghfgh whats going on

wet breach
#

2d array would be the same as 3d, just 2dimensions. Each dimension can be in separate areas in memory

young knoll
#

Storing blocks in a map?

rough drift
#

still doesn't work though

rough drift
wet breach
#

so in terms of memory efficiency, a multi-dimension array is better if its able to be used then a single dimension array

rough drift
#

I need to do that temp

young knoll
#

As a key?

slender elbow
#

since when is memory fragmentation a good thing

rough drift
wet breach
#

even mc uses multi-dimension arrays for location stuff

young knoll
#

The blocks location should work

#

However you could go down to a BlockVector

wet breach
slender elbow
#

you are not allowing it to be a contiguous blob in memory, so, yes, it is memory fragmentation

wet breach
#

no

slender elbow
#

okay

wet breach
#

but I am not going to explain something you don't understand either

slender elbow
#

lmfao

#

asshole

wet breach
#

yep

slender elbow
#

"why would i want to educate you"

#

"why would i want you to learn something"

wet breach
#

You can't guarantee contiguous space for everything, if there is not enough contiguous space for an array Java throws OOM

#

multi dimension arrays, each dimension doesn't not need to be right next to each

#

because there is a pointer for the next dimension if the next one is needed

slender elbow
#

the GC can move stuff around on the jvm heap

#

and will

wet breach
#

so each dimension can have its own contiguous space in different parts of the memory

wet breach
slender elbow
#

yes it does when it needs memory

wet breach
#

anything touching native code can't be moved on the heap otherwise it gets a new pointer, hence why using JNI the GC will not touch that area of memory at all otherwise you get all kinds of errors on both sides because pointers changed

#

so no GC can't always move stuff

slender elbow
#

what does native code even have to do with anything

wet breach
#

most times it can because not everything is touching native code

slender elbow
#

this is jvm heap we're talking about

wet breach
#

indeed

#

and what I stated is true

slender elbow
#

and what i stated is true either

wet breach
#

no its not

slender elbow
#

lmfao

wet breach
#

you obviously don't understand how pointers work

#

Java is not an exception to this

slender elbow
#

i do understand how pointers work

wet breach
#

Java doesn't magically bend the rules of native stuff it can only work around it

slender elbow
#

you clearly don't understandd how the jvm heap works

rough drift
#

Hey lads

#

it was working

#

I just misunderstood an event

river oracle
#

now look what you did

#

be ashamed

rough drift
#

BlockRedstoneEvent only triggers for the source block

#

?nms

river oracle
#

did you follow the steps at above link ^

wet breach
slender elbow
#

i think i know what i'm talking about

#

i think everyone here would appreciate it if you stopped being an asshole

#

just saying

river oracle
#

ladies I think we can settle this by just looking at JVM internals its time to get digging Party

rough drift
#

frostalf is right though

slender elbow
rough drift
wet breach
wet breach
#

Emily believes the GC can touch native stuff and just move it around willy nilly

wet breach
#

I know this

rough drift
#

I mean it can edit the JVM's memory as it pleases

slender elbow
slender elbow
#

stop putting words in my mouth lmao

rough drift
# wet breach no

I was left under the assumption that a process can change it's own memory as it pleases

river oracle
#

if it doesn't ofc arbitrary memory editing would be possible

#

but I would see that as potentially dangerous

wet breach
# rough drift I was left under the assumption that a process can change it's own memory as it ...

it can to an extent, the issue is that when it comes to native stuff, pointers can't just change without stuff just dying. So anything in memory has a pointer, this includes any memory reserved for a process. You still need pointers to know where it is at in memory. If the GC starts moving around space that is for native stuff, the pointers will change and the native stuff won't know where it went because there is no way to tell it

slender elbow
#

the jvm has control over its own heap, if the heap itself has and needs X bytes available, but it is not available contiguously, it can and will move stuff around within the heap to make up that for that contiguous space

wet breach
#

so, instead, anything native is cordoned off from the GC until its done

#

the GC works around it

rough drift
#

ah yeah makes sense

slender elbow
river oracle
#

wouldn't an array just be stored in the JVM heap though not native

slender elbow
#

it would

wet breach
slender elbow
#

it will realloc as necessary, but it is true

#

there are entire papers about it

wet breach
#

also, if objects are large enough, they will sit outside of the heap as well

#

which is far worse then fragmented in heap

#

there is even a jvm flag for this to increase space for such things so you don't end up with objects outside of the heap

wet breach
#

however my point wasn't that an array couldn't be moved, just was correcting the belief that the GC has the ability to move anything in heap to anywhere it wants. Technically it does, but it doesn't do this for the reasons I stated

rough drift
#

I mean yeah I was talking about what it could do, not what it should do

slender elbow
#

anything within the jvm heap, it can and it will

rough drift
#

it probably won't

slender elbow
#

it depends on the circumstances

#

it doesn't do it arbitrarily every 3 seconds for no reason ofc

wet breach
slender elbow
#

no

wet breach
#

well if you can't do that then its not true that GC moves everything

#

so....

slender elbow
#

man you sure are annoying

#

this has nothing to do with native code, i am very much explicitly saying within the jvm heap

#

i don't have time for you

onyx fjord
#

🧌

wet breach
#

memory is memory

#

it doesn't change because of the process

#

would you demonstrate to me that the hardware of memory changed because Java reserved Addresses of the memory from one point to another? even though the address space between those points are reserved for java, java still has to specify where in between those points stuff is at

#

there is no way to tell some native code that a pointer changed

#

and therefore, Java and its GC will not move such things in its memory space if its for native use

#

Nice

#

have no idea

#

I don't use such things

slender elbow
wet breach
#

depends, there is some things in java that are tied to native

#

anything IO for example

slender elbow
#

that lives outside of the jvm heap

wet breach
#

my point was clarifying that the GC does not move everything as you claimed and there is stuff it simply won't touch at all and for good reason

slender elbow
#

🤓 ok sir yes sir

wet breach
slender elbow
#

managed objects live inside the jvm heap, but the native buffers live off-heap

wet breach
#

Objects can end up outside of the heap

slender elbow
#

no they cannot

wet breach
#

there is even a JVM flag for this to help prevent that happening

slender elbow
#

prove it

cinder abyss
#

Hello, how can I get a random location in a radius with the player for center?

wet breach
#

alright, give me a moment to find the JVM flag

cinder abyss
#

like this
black dot is player,
red circle is possible locations

eternal night
#

Create vector with (n, 0, 0) and rotate it by a random number between [0, 2pi] around the y axis

#

the bukkit vector type has utilities for rotation around the y axis

grim hound
#

can someone link me the mapping website again?

eternal night
grim hound
#

thanks

grim hound
cinder abyss
#

what is your ide ?

eternal night
orchid gazelle
grim hound
eternal night
#

its a mappings page

grim hound
#

ye?

eternal night
#

it has names

#

not source code or changes

grim hound
#

I know

#

but it does show

#

constructor and class name changes

young knoll
#

Yes

#

Those are names

eternal night
#

it shows you the names in the different mappings

#

if you mean "mappings" when you say versions kekwhyper

dry hazel
#

there is a clock icon on every class page that you can click to have a cross-version overview of the class

eternal night
#

how do you know that huh

dry hazel
#

😝

eternal night
#

the old page was better

orchid gazelle
#

lynx, what is your favourite amount of degrees from 0-360?

eternal night
#

degree users are cringe

slender elbow
#

radian enjoyer

eternal night
#

for sure

orchid gazelle
#

then tell me in rads

slender elbow
#

epic

orchid gazelle
#

favourite from 0-2pi?

#

(90% of school in maths/physics here is degrees only)

eternal night
#

0pi obviously

umbral ridge
#

hi optic

#

hows your PCs? xD

young knoll
#

Few days late on that reply :p

cinder abyss
#

oh ok

orchid gazelle
#

no u

cinder abyss
orchid gazelle
#

well that's a length of 5

#

do you want ANY place in the circle or with the specified radius of 5?

orchid gazelle
#

ah ok

cinder abyss
#

If I want any place of the circle I do another random between center and max

young knoll
#

what is that random number selection code

eternal night
#

yea

cinder abyss
eternal night
#

pls no

cinder abyss
young knoll
#

With threadLocalRandom can't you just do nextDouble(0, 2 * pi)

eternal night
#

Just ThreadLocalRandom.current().nextDouble(Math.PI * 2) is fine

young knoll
#

ah true 0 is the default min

eternal night
#

Or create a class-wide random instance

#

but the rest looks fine yea

cinder abyss
#

decompile minecraft no x)

river oracle
#

decompile the jar

#

that

eternal night
#

I mean

river oracle
#

is the only option

cinder abyss
young knoll
#

Buildtools already has that available for you

cinder abyss
#

You want the source package?

young knoll
#

In the work folder

grim hound
#

How can I get the window ID to send a spoofed PacketPlayOutWindowItems?

river oracle
#

so ServerPlayer#containerId

umbral ridge
grim hound
umbral ridge
#

xD

#

welcome

eternal night
cinder abyss
#

Mojang : obfuscating code
Also Mojang : creating a mapping for developers

grim hound
#

so uh

river oracle
#

are you legacy?

cinder abyss
grim hound
cinder abyss
grim hound
river oracle
grim hound
#

1.14+

cinder abyss
river oracle
#

specifically before 1.17.1 is when spigot support for mappings first came out

cinder abyss
river oracle
#

so you'd have to make your own plugin to remap afaik

young knoll
#

Well they did

#

They have spigot mappings

river oracle
#

moj maps I meant

#

@young knoll moj maps PR when?

grim hound
#

can we get back to the topic?

#

on how to get the container id

river oracle
#

its a field in ServerPlayer

#

called containerId look at the obfuscated equivalent from the mappings site

grim hound
young knoll
#

Yeah it'll be EntityPlayer.some letter

grim hound
#

or can I retrieve it from the Inventory object?

river oracle
#

no

#

its not hard to use the mappings website

#

what version are you on

young knoll
#

1.14 plus

eternal night
young knoll
#

So it sounds like several

river oracle
#

containerCounter

#

that's the field

wet breach
# slender elbow prove it
TLABSize
MinTLABSize
TLABAllocationWeight
TLABWasteTargetPercent
TLABRefillWasteFraction
TLABWasteIncrement
GCDrainStackTargetSize
CodeCacheMinimumFreeSpace
MaxDirectMemorySize
UseMallocOnly
ZapJNIHandleArea

all of these are for controlling stuff that are outside of heap space, took a bit of time to find these since the darn list of options is huge now -.-

river oracle
#

obfuscated its cw

#

for vresion 1.14.4

grim hound
river oracle
cinder abyss
# eternal night Create vector with (n, 0, 0) and rotate it by a random number between [0, 2pi] a...

final code:

if (players.size() <= 2) {
  Player choosenPlayer = players.get(ThreadLocalRandom.current().nextInt(1));
            
  Vector initialVector = new Vector(5, 0, 0);
  double randomAngle = ThreadLocalRandom.current().nextDouble(Math.PI * 2);
  Vector rotatedVector = initialVector.rotateAroundY(randomAngle);
  return new Location(players.get(0).getWorld(),
    choosenPlayer.getLocation().getX(),
    choosenPlayer.getLocation().getY(),
    choosenPlayer.getLocation().getZ()).add(rotatedVector);
}```
wet breach
# river oracle obfuscated its `cw`

so after going through the JVM options lists, I came across that I forget there is a JVM option for self destructing after a pre-defined time

young knoll
cinder abyss
wet breach
#

also you might like this one

cinder abyss
#

but is the code correct?

wet breach
#

ZapUnusedHeapArea - Zap unused heap space with 0xBAADBABE

young knoll
#

Looks like it'll work

umbral ridge
#

lol

young knoll
#

Correct may be another thing :p

cinder abyss
#

okay thanks

wet breach
#

not that any of this info is probably useful to you

#

just a bit of curiousity

river oracle
#

wonder who this is useful to

young knoll
#

JVM developers I assume

cinder abyss
#

I'm silly

young knoll
#

Don't think it matters

#

Bukkit vectors are mutable

cinder abyss
young knoll
#

If you add or rotate or multiply them

#

It'll modifiy the initial object rather than creating a new one

quaint mantle
#

hey can i spawn a zombie in the server, but make the client think it is a player

young knoll
#

Not super easily

#

But yes

quaint mantle
#

how would i do it?

umbral ridge
#

nice halloween hat

#

xD

young knoll
#

What version

quaint mantle
#

1.20.2

#

can i modify the outgoing clientboundpacket?

young knoll
#

Yes

quaint mantle
#

and just change the entityType to player

young knoll
#

In 1.20.2 players use the same spawn packet as other entities

#

So changing the type should be fine

quaint mantle
#

how would i catch the packet?

alpine urchin
#

yea

young knoll
#

Make a packet listener

#

Either via Netty directory or with PacketEvents/ProtocolLib

quaint mantle
young knoll
#

1.20.2 I think

#

lol

wet breach
#

maybe I should give this a try at some point as I haven't really tested what happens if you force MC to use native space only

river oracle
slender elbow
#

that option no longer exist and neither does the zap jni handle area

quaint mantle
#

i just have to catch it from the server

#

right?

young knoll
#

I mean I think either way you inject into their connection

quaint mantle
#

but you inject to detect serverboundpackets right
not clientbound?

young knoll
#

Both

#

Everything is routed through the connection

quaint mantle
#

hmm ye, but do i "need" the connection
or is there a other / easier way

wet breach
#

clientbound packets are packets that are heading out to the client, and server bound is from client to server, you can listen for either and catch either and do stuff with them before its sent or fully received(processed in this case)

#

or you can just swat them if you just don't want those packets leaving at all or being processed by the server XD

#

up to you in whatever is you are doing

grim hound
#

does anyone know what the last ItemStack is for?

slender elbow
#

it's the item on the player's cursor

grim hound
#

so like

#

when I'm spoofing the items

#

do I just input the constant

#

that's with the null material?

slender elbow
#

uh sure? if you want the cursor to be empty then passing the air item might do it, never messed with that

upper hazel
#

how do highest priority in eventHandler

grim hound
young knoll
#

It's the cursor

grim hound
young knoll
#

Yknow, the thing you move with your mouse

upper hazel
#

i mean @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
not work

slender elbow
#

when you click on an item, you hold it on your cursor

#

until you place it down or drop it etc

grim hound
#

so if you hold none it should be the empty item one?

#

got it

#

thanks

slender elbow
#

yeah prolly

young knoll
#

Yeah either air or null

#

Idk what the protcol expects

slender elbow
young knoll
#

Ah yeah it does do operations on it

grim hound
#

the material will be null

#

this one

slender elbow
#

that's the one yeah

upper hazel
grim hound
young knoll
#

?notworking

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.

upper hazel
#

I'm trying to block another same event in another plugin

young knoll
#

what

upper hazel
#

i try cancel BlockBreakEvent but this not cancl cuse another plugin use it

quiet ice
#

Incredibly random question, but is CMPXCHG16B for 64 bit values or does it also support 128+ bit stuff?

upper hazel
#

what?

grim hound
#

does somebody really use event.setCancelled(false)?

#

like the plugin uncancels the event?

young knoll
#

I mean it's possible

#

Doubt it happens much

ivory sleet
#

And sometimes 128

quiet ice
#

Then why is it suffixed with 16B - wouldn't that entail 128 bits at 8 bits a byte?

ivory sleet
#

Actually yes you’re right

#

(I think lol)

peak depot
#

whats the right bungeecord event for getting the player on intial server connect

quiet ice
#

Yeah, but that suggests it's either or

wet breach
#

no it doesn't

#

look at the order

quiet ice
#

Ah bruh, it's two different insns

#

I may have a slight case of severe brain damage

wet breach
#

lol

quiet ice
#

Now I only need to randomly stumble uppon the ARM equivalent and I'm set for really stupid stuff.
Or well, I could use GCC and hope it uses the right equivalent but what is the fun in that?

cinder abyss
#

Hello, when NamespacedKey was introduced?

quiet ice
cinder abyss
quiet ice
#

I wish there was some javadoc site for ancient bukkit versions that was compiled with modern Java

wet breach
hushed spindle
#

how intense are raytraces to servers, like if i do a relatively short trace of a couple blocks every tick for maybe a couple players is that a big deal or nah

mighty acorn
#

Anybody can help me here?

My Plugin always says Vault not found even its installed.

quiet ice
hushed spindle
#

if its your plugin show the code for vault detection

#

otherwise we cant help you

grim hound
#

is there a way to set an ItemMeta's display name to an empty string?

hushed spindle
#

yeah just make it empty

#

""

mighty acorn
grim hound
#

doesn't work

hushed spindle
#

try just a color code then

#

or like a 0-width space

hushed spindle
#

and if you plan to publish it consider picking a different name because chunky is already a widely used plugin

grim hound
grim hound
#

since I want it to be the heritage for an anvil input

#

and I want the input to be empty

hushed spindle
#

then 0-width space?

mighty acorn
grim hound
hushed spindle
#

a space with 0 width

#

like

#

#
#

select whats in that box and you got a 0 width space

grim hound
#

eternal oxide
#

U+200B

grim hound
#

dassick

#

thanks

#

it won't be detected by String#isEmpty right?

hushed spindle
#

might wanna double check if that displays properly in minecraft tho

#

nope because its a character

#

it just has 0 width

wet breach
# quiet ice Then why is it suffixed with 16B - wouldn't that entail 128 bits at 8 bits a byt...

because its 16 bytes, there is 4 bits per byte, thus giving you 64bits, the instruction here is for double width so 128 bits because 16bytes:16bytes. The other instruction 8b is 8 bytes, double width gives 64bits. 8b is primarily for if you are dealing with 32bit registers, like integers for example and it works from 64bit cpus, but is also handy when on a 32bit cpu as well. and 16b is only available on 64bit cpu's but handy if you need double the width or dealing with only 64bit registers

#

to give you further clarification

grim hound
#

it does not

#

display as widthless

hushed spindle
#

sad

grim hound
#

it's some weird symbol instead

quiet ice
#

hm, 4 bits per byte is something I haven't seen yet.

hushed spindle
#

why cant you use a color though

#

like even &r

grim hound
#

I mean

#

I'm opening an anvil gui

#

and the input is the renaming

#

and the primoridal input is inherited from the item's display name

#

so it will probably turn into

wet breach
#

16bytes = 128 bits

grim hound
#

\u00A7

grim hound
hushed spindle
#

if you're using the anvil just for text input stuff you might wanna consider using chat instead

wet breach
#

8bytes = 64bits they are double width

grim hound
#

so tis a custom feature

quiet ice
#

Ah I thought I have just seen some low-level specifics that I have never been taught.

wet breach
#

lmao

#

I wish

quiet ice
#

But yeah, so it is what I assumed. I just each time confused the 64 bit and the 128bit variant as they are usually listed besides each other

wet breach
#

8b is used when dealing with 32bit registers or 32bit cpu. and 16b when dealing with 64bit registers which means 64bit cpu but that is a given 😛

#

and DWCAS has always been available in ARM as well, and its the instructions I gave above but in double width, so it shouldn't be hard to convert over for whatever you are trying XD

quiet ice
#

Yeah most AMD and Intel CPUs should support both instructions so I am not worried on that front

#

And those that do not support these instructions cannot support modern OSes anyways as it appears so

wet breach
#

ldrex/strex (ARMv6 and v7), and ldxr/stxr (ARM version 8)

quiet ice
#

I mean I don't need those instructions just yet - it was more of a nice to know question

wet breach
#

ah

#

well now you know

quiet ice
#

Honestly I thought it was there for longer, but 1.12 was the time I started with bukkit so makes sense

cinder abyss
hushed spindle
#
RayTraceResult result = p.getWorld().rayTrace(p.getEyeLocation(), p.getEyeLocation().getDirection(), 5, FluidCollisionMode.NEVER,
                    true, 0, null);

how come this isnt hitting a block when im looking right at it? definitely under the 5 block radius

#

result.getHitBlock() returns null

grim hound
#

yo what the f-

#
listConstructor = listClazz.getConstructors()[0];
#

this threw an OutOfBounds error

hushed spindle
#

then it empty

grim hound
#

but it's a

#

constructor

#

array

#

so what the fuck

#

it must have some sort of constructor

#

anyone?

slender elbow
#

does listClazz represent an interface?

grim hound
#

nope

#

that's why I'm confused

slender elbow
#

what is it exactly?

grim hound
#

does

#

the fact that it's protected

#

exclude it?

dry hazel
#

what about getDeclaredConstructors

cinder abyss
#

maybe because it's protected

grim hound
#

yeah I'm sorry for swearing

#

okay now I'm mad confused

#

but

#

did not throw an error

#

but this did

dry hazel
#

what does the getMethod call do?

grim hound
#

this is the original

grim hound
#

it didn't throw an error

#

only the call to it did

dry hazel
#

well what I wanted to know is what's in the getMethod method lol

grim hound
echo basalt
#

you need to pass an instance to invoke the method on

#

just pass null if it's static

#

so invoke(null, item)

grim hound
cinder abyss
#

hello, how can I clone an entity at another location?

eternal night
#

not really possible with the api yet

cinder abyss
#

okay thanks

grim hound
#

tis the constructor

#

tis da erro

#

like which argument?

#

the method

rotund ravine
#

What’s the nms create list thing

grim hound
#

I should mention that I got the classes FROM the existing constuctors

grim hound
grim hound
rotund ravine
#

What arguments does reflection say clazzConstructor takes?

grim hound
grim hound
cinder abyss
grim hound
cinder abyss
#

do someone have an explanation?

grim hound
#

to put a

#

class with the specified parameter type

cinder abyss
#

that's what I do?```java
public abstract class CustomMob<T> {
public T entity;
public HMobsType type;

public CustomMob(Class<T> entity) {
    this(entity, false);
}

public CustomMob(Class<T> entity, boolean silentSpawn) {
    this(entity, HMobsType.GENERIC, silentSpawn);
}

public CustomMob(Class<T> entity, HMobsType type, boolean silentSpawn){
    if(!entity.isInstance(Entity.class)) throw new IllegalStateException("T entity must be an Entity!");

    T spawned = SpawnMob.getRandomLocationWithinPlayers(new ArrayList<>(Bukkit.getOnlinePlayers()))
            .getWorld()
            .spawn(SpawnMob.getRandomLocationWithinPlayers(new ArrayList<>(Bukkit.getOnlinePlayers())),
                    entity, (pig) -> {
        pig.setCustomName("oliver193");
        pig.setCustomNameVisible(true);
});

...```

lost matrix
lost matrix
#

First of all: Make your fields private pls

pseudo hazel
#

why not just use Entity instead of T

cinder abyss
cinder abyss
grim hound
# grim hound I'll debug em one sec

public net.minecraft.network.protocol.game.PacketPlayOutWindowItems(int,int,net.minecraft.core.NonNullList,net.minecraft.world.item.ItemStack) so as expected

cinder abyss
# cinder abyss why?

idk the difference between accessing variable and accessing function accessing variable

lost matrix
# cinder abyss why?

Because you never want other classes to have access to your fields.
Strong encapsulation is one of the most important principles to write robust code.

cinder abyss
#

oh okay

pseudo hazel
#

or atleast make them like final

grim hound
lost matrix
#

Lets see what the problem with your generics could be

lost matrix
cinder abyss
#

okay thanks all!

lost matrix
echo basalt
#

why is bro spawning a pig with oliver's name

cinder abyss
# echo basalt why is bro spawning a pig with oliver's name

When you want to spawn a custom entity, e.g. with a custom name or certain items equipped, you must use the method World#spawn(Location, Class, Consumer) unless you give a shit about compatibility with other plugins. I’ll explain why. The shitty way Usually, you can easily spawn entities like this: That is fine, as...

#

code isn't finished

cinder abyss
# lost matrix You are going to have huge problems btw because you are getting the world from o...

I made a variable containing the Location
also, I do that:```java
public static Location getRandomLocationWithinPlayers(List<Player> players) {
List<Player> filteredPlayers = majoritary(players, Player::getWorld);
World world = filteredPlayers.get(0).getWorld();
...
}

....

public static <T, E> List<E> majoritary(List<E> elements, java.util.function.Function<E, T> classifier) {
Map<T, List<E>> grouped = elements.stream()
.collect(Collectors.groupingBy(classifier));

    return grouped.values().stream()
            .filter(list -> list.size() == grouped.values().stream()
                    .mapToInt(List::size)
                    .max()
                    .orElse(0))
            .flatMap(Collection::stream)
            .collect(Collectors.toList());
}```
orchid gazelle
#

dude that looks hacky asf lmao

cinder abyss
orchid gazelle
#

great

cinder abyss
#

my code is working thanks

pseudo hazel
#

doesnt mean I understand whats going on though

quaint mantle
#

oh

#

@jagged quail

quaint mantle
#

tbh it was mfnalex

#

where is that guy anyways

grand flint
#

paul has beef pork 🐷

#

how do u cross a word 😭

lost matrix
quaint mantle
lost matrix
#

This can also be shortened by quite a bit

young knoll
lost matrix
heavy mural
#

I have an entity item_display which I want a player to perceive to be at their Y level continously. Is this possible, without being too resource heavy?

lost matrix
#

With 1-20 players, the split and join would most certainly produce more overhead than just streaming this consecutively

#

Ive written a fork with some guys that had ~150 people on one instance with still 20 TPS

#

*Was 1.8 back then

echo basalt
#

just run minestom 🗿

young knoll
#

What on earth is this code

umbral ridge
#

I guess that's what paper is for xD

#

and other forks

lost matrix
#

Myeah. Really depends on what you are doing.
If its not survival then you can get 200 people on one 1.20 server without much optimizations.
In the end its just 200 entities with maybe 3x load resulting in effectively 600 entities. (Which you can handle with good hardware)

echo basalt
#

throwback to when I had 18k citizens npcs all wandering on a shared host

lost matrix
#

Their max load is pretty similar to spigots in that regard

umbral ridge
#

But it's more optimized yeah?

lost matrix
# umbral ridge But it's more optimized yeah?

It handles a select amount of systems in a different manner.
Some might be more optimized, but in most cases this only matters for survival servers.
Do you know how to utilize the changes of this fork?

orchid gazelle
#

intel i9-14900K*

#

On overclock plz

umbral ridge
#

I might start to use it though it would be nice to know

orchid gazelle
#

It would just take entity tick multithreading

lost matrix
# umbral ridge Nope I don't use paper

Understanding the platform and optimizing your project for its purpose is much more important than choosing which fork you are using.
If you dont need entities, then dont spawn entities. If you dont need chunks from -64 to 256, then dont generate huge chunks. And so on.

orchid gazelle
#

We could easily make it happen at the cost of every second plugin breaking and it being harder to make plugins

lost matrix
#

Minestom already has multithreading capabilities and can def handle 250 players if not much is going on

#

The problem is that you need to reinvent the wheel, if you want to use it.

orchid gazelle
#

Yeah but that's running on C++

umbral ridge