#help-development

1 messages · Page 382 of 1

fresh timber
#

also if arrow despawns, will this info be deleted?

lost matrix
#

It wont slow your server and if an entity despawns then its whole data will ofc be deleted

fresh timber
#

alr

#

tysm

#

how do you get the projectile or arrow entity that was in the air before in an EntityDamageByEntityEvent?

lost matrix
#

getAttacker()

fresh timber
#

thats the player right

lost matrix
#

-> then check if instanceof Projectile

fresh timber
#

ah

lost matrix
#

The attacker will be the arrow entity

fresh timber
#

oh event.getAttacker() is not a thing

lost matrix
#

Wrong event

fresh timber
#

hm?

lost matrix
#

EntityDamageByEntityEvent not EntityDamageEvent

fresh timber
#

thats the one im in

lost matrix
#

Ah getDamager()

fresh timber
#

so if I checked before if the cause is damagecause projectile do I still needa check if the damager is instance of projectile

#

or just getdamager

lost matrix
fresh timber
#

alr

#

so if getdamager is the entity projectile, what is the player that attacked you

#

or are they the same..

twilit wharf
#

Not sure if this is the right place for this, but I am making a chess plugin, and I am curious how I can go about making a full sized board (8x8). I am using the unicode system for the icons and textures. Does anyone know of a way to allow the player to easily control every piece from the menu, and not external commands?

lost matrix
#

Where is this chess board located? In an inventory? On Blocks? On a Map? In Chat?

fresh timber
#

How do you get the player that attacked in an entitydamagebyentity event if getdamager is the projectile?

twilit wharf
terse pumice
#

Would anyone happen to know how to get a specific light block (eg. light level 12) as an ItemStack?
Unsure if this information is useful but this is the command to give it: /minecraft:give Dav_e_ light{BlockStateTag:{level:"14"}} 1

lost matrix
twilit wharf
lost matrix
#

Ah i see the problem... Well nothing you can do there.

twilit wharf
#

I know it is possible, I just don't know how. I saw someone use an entire screen worth of space and have everything clickable (no mods, vanilla and a resource pack). They mentioned it involved core shaders.

fresh timber
#

make chess thing not in inv

#

like on ground or smthin

lost matrix
#

Some meh ideas:

  • make the inventory scrollable
  • Use the players inventory as well
twilit wharf
#

Someone managed to make something like this, with the whole thing interactable. Like I said above, this was done with core shaders (which I have no clue how or even what they do)

fresh timber
#

o.o

#

I wonder whow much work that took

twilit wharf
#

They act like it took no work at all.

fresh timber
#

tf..

twilit wharf
#

I can share the link to their discord, there is a bunch of cool things like that on there.

lost matrix
twilit wharf
#

with the unicode system and all

lost matrix
twilit wharf
#

Well, I just don't understand the actual concept behind it. If I knew how it worked and how it could be replicated, then I could work out the drawing and stuff later.

lost matrix
#

Well if you use a resourcepack then you can just create a 9x6 inventory, use the players inventory as well (3 rows) and
use a replaced inventory name as a chess board texture. The pieces can be actual ItemStacks.

twilit wharf
#

hmm

twilit wharf
#

not sure if discord links are allowed here, but that is the invite to the discord

lost matrix
twilit wharf
#

I know how to do all of that

#

That isnt the issue.

lost matrix
#

What is the issue then?

twilit wharf
#

I just wanted to know if there was a way to get an interactable gui bigger than a regular inventory, since obviously others have been able to achieve that.

#

and if I use the player's inventory, then I get the Inventory text and the gap where it isnt interactable, which wouldn't be very pretty in production.

twilit wharf
#

yep

winged anvil
#

bedrock or java?

twilit wharf
#

Java

lost matrix
# twilit wharf Java

Honestly i couldnt figure out how they did this by now. What informations do we have?

twilit wharf
#

nothing. I contacted the guy and all he told me was it was core shaders.

#

he didnt say anything more, and I didn't feel like being pushy was the right way to go.

#

they obviously werent directly stating how they were doing things, and that is probably from a business standpoint. If you let your competitors know how your entire business operates, what stops someone with more resources from out pacing you and stealing your marketshare.

lost matrix
#

Yeah the shader part i understand. Those are just some opengl shaders.
But how are they registering the clicks?

twilit wharf
#

yeah, I got no clue.

winged anvil
#

oh damn each button is actually its own button and not like a collection of slots?

#

this would be fire if we could figure it out cause id be able to make everything ive wanted to in terms of ui

lost matrix
#

Let me take a look at the protocol... Maybe there is some packet which sends screen space locations.

trim lake
#

Im making anvil rename gui, how to remove cost of rename? I tried this:

@EventHandler
    public void handleMenu(InventoryClickEvent e) {
        Player p = (Player) e.getWhoClicked();
        AnvilInventory anvilInv = (AnvilInventory) e.getInventory();
        anvilInv.setRepairCost(0);
        if (e.getSlot() == 2) {
            //ItemStack item = e.getCurrentItem();
            ItemStack item = anvilInv.getItem(2);
            String newName = item.getItemMeta().getDisplayName();
            FactionRankUtils.rename(faction, rank, newName);
            p.closeInventory();
            p.sendMessage(ChatUtils.format("&aÚspešne si premenoval rank &e" + rank + " &ana &e" + newName + "&a."));
            return;
        }
        p.sendMessage("Slot: " + e.getSlot());
    }```
trim lake
#

Oh, I cannot do that in InventoryClickEvent? daaam, that's complication 😄 So, chatGPT is dump 😄 I tried that (ChatGPT) to create this GUI, and it suggest me to do that in InventoryClickEvent.

trim lake
trim lake
#

Hmmm, event is not called with custom anvil inventory. But, if I clicked on anvil and start renaming some item is working. Any ideas?

#

Im using this to create and open inventory, mby thats a issiue?

Inventory inv =  Bukkit.createInventory(this, InventoryType.ANVIL, ChatUtils.format(getTitle()));

player.openInventory(inv);
frank kettle
#

It somehow looks correct but something or multiple things are always wrong.

trim lake
jagged monolith
#

?services

undone axleBOT
quaint mantle
trim lake
#

Any ideas why is PrepareAnvilEvent not called with custom inventory?

wet breach
#

As in more slots?

lost matrix
rough basin
#

Why unstackable items get stacked when I use reload

rough basin
#

Damn need translation app

#

Wait a sec

lost matrix
#

First of all: never use reload. It breaks half the plugins

rough basin
#

nah ignore me, will be return with more info

wet breach
#

If not then getting the sides to display like that isnt hard if we are not worried about interacting with it

lost matrix
#

You might have a point. Maybe its just visual

lost matrix
#

A chess board has 8x8 tiles. How can this fit in an inventory...

wet breach
#

You would use two inventories with custom textures to hide that sliver.

lost matrix
#

I thought 6x9 inventories arent possible anymore. So there would be a gap between top and bottom inv

wet breach
#

The gap is visual only

#

So you would just use a custom texture to remove the gap

#

But player inventory and double chest inventory has enough rows and slots for a chess board

lost matrix
#

This gap doesnt look visual-only to me

wet breach
#

This is where the shaders come in. Smoosh the graphic enough and its gone

lost matrix
#

I know that in earlier versions you could create one more row which would create a seemles big inventory

#

Never call anything main

wet breach
#

Recommended to name it after your plugin or related

#

You only name it main if its the main class of the entire program

lost matrix
#

Even then you would go for something like Application

wet breach
#

Well i wasnt counting plugins as programs exception being ones that can run standalone in which case application is more fitting

#

Those are typically called manager classes. But for plugins typically your main class is named after the plugin or a short name variant if its a long name lol

wet breach
#

Been needing to decompile the client anyways as well

worldly ingot
#

AbstractManagerFactorySupplier (/s)

lost matrix
#

DataFixerUpper.function10

twilit wharf
twilit wharf
lost matrix
#

Well... Its a decent troll.

#

if player is in survival -> put him in creative
else -> put him in survival

Thats the short form of your code

#

This will break console commands

#

Blindly casing CommandSender to Player

#

Yes

#

Sure if it helps you learn then go for it.

#

Also: You fool nobody with your new name Bettanation 😅

left plover
#

What about a default case?

#
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String alias, String[] args) {
        Player p = (Player) sender;
        if (sender instanceof Player) {
            if (p.isOp() && cmd.getName().equalsIgnoreCase("/gmswitch")) {
                switch (p.getGameMode()) {
                    case SURVIVAL:
                        p.setGameMode(GameMode.CREATIVE);
                        break;
                    default:
                        p.setGameMode(GameMode.SURVIVAL);
                        break;
                }
            }
        }
        return true;
    }
tender shard
#

why are you manually checking the command's name? also it'll never be equal to "/gmswitch" unless the player entered "//gmswitch"

#

also you should use proper variable names instead of "p"

#

also why do you have 3 times the same case?

#
                    case ADVENTURE:
                    case CREATIVE:
                    case SPECTATOR:
                        p.setGameMode(GameMode.SURVIVAL);
                        break;
                    case SURVIVAL:
                        p.setGameMode(GameMode.CREATIVE);
                        break;
#

wouldn't that be much easier?

undone axleBOT
tender shard
#

also why are you manually checking whether the player is op instead of just using a properly defined permission in plugin.yml

worldly ingot
#

Permissions are so last year

tender shard
#

your mum

worldly ingot
lost matrix
tender shard
#

this kinda seems overly complicated to me

worldly ingot
#

I like how he just says he's gonna make a resource then just does it

tender shard
#

why not just write "yo, add a string PDC tag to your items to identify it"

lost matrix
worldly ingot
#

Easiest resource thread ever

#

"lmao just get good and do it"

lost matrix
#

XD

tender shard
#

this indeed looks like an overly complicated approach to me

#

where's the MyCustomItemFactory that implements Factory<MyCustomItem>

lost matrix
#

Really? I tried thinking about the most basic approach i did back when i started using custom items.
What critic do you have?

tender shard
#

that it is overly complicated. I'd simply attach a string to the ItemMeta, e.g. "my-custom-item-id": "explosion-sword"

#

yeah and that's it

#

i dont wanna say that using all this enum stuff is bad, but it's definitely overly complicated, especially if it's written for beginners

lost matrix
#

Ah i see what you mean. But this is the basis for the next step in the tutorial where i linked functionality directly to the types

#

But i can see what you mean...

tender shard
#

for example I didnt know that enums can have abstract methods

lost matrix
tender shard
#

that'd be nice :3

tender shard
#

it only stops complaining when you actually add an enum value (and implement that method inside that) lol

#

why do you still have 3 same cases?

eternal oxide
#

he means use switch fall through

tender shard
#

these cases are all the exact same

eternal oxide
#

you can make it even shorter using lambdas

#

but it might become a little harder for most to read

sterile axle
#

that's going to throw a ClassCastException if console runs it

#

look at the order you do the cast and instanceof

eternal oxide
#

yep, you cast player before testing

sterile axle
#

looks fine without any extra flashy syntax sugar

wet breach
#

Once you learn this you can move onto bitshifting instead uwu

tender shard
#

?

sterile axle
#

on modern java you could make it something like

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String alias, String[] args) {
        if (sender instanceof Player p) {
            if (p.isOp()) {
                p.setGameMode(switch (p.getGameMode()) {
                  case ADVENTURE, CREATIVE, SPECTATOR -> GameMode.SURVIVAL;
                  case SURVIVAL -> GameMode.CREATIVE;
                });
            }
        }
        return true;
    }
tender shard
#

imho

sterile axle
#

🤷‍♂️

#

just providing alternative syntax

#

they do the same job either way

wet breach
tender shard
#

game mode is a bit mask?

#

am I too drunk to understand this lol

#

maybe

wet breach
#

In the packets and nbt data yes

tender shard
#

hm yeah okay lol

quaint mantle
sterile axle
#

You could OR the two bit patterns together and send it in a packet but the client would probably freak out about it and not do what you requested

#

So yes but also no

quaint mantle
#

I said theoretically for a reason lol

sterile axle
#

And I answered

quaint mantle
#

That's pretty funny, but also very weird.

#

Where would that even be useful?

sterile axle
quaint mantle
#

I use bit twiddling all the time

sterile axle
#

oh yeah i dont know

#

they're exclusive states so not sure why they do it like that

quaint mantle
#

It's certainly an interesting design choice.

sterile axle
#

Minecraft in general is a series of interesting design choices

tender shard
#

gamemodes are not bitmasks

#

they are just 0,1,2,3

quaint mantle
#

Ah, well that answers that

tender shard
#

(taken from this weird wiki.vg site)

wet breach
sterile axle
#

im inclined to think he meant they're just bit patterns.

0 => 00, 1 => 01, 2 => 10, 3 => 11; so theoretically you can Creative | Adventure => 01 | 10 => 11 which is spectator game mode

#

but 🤷‍♂️

#

(what isn't a bit pattern tho)

tender shard
#

011 isn't 3 but 4 or am I stupid

sterile axle
#

011 is 3

kind hatch
quaint mantle
#

11 is 3, 1 + 2

sterile axle
#

oh

#

i fucked that up

#

kekw

tender shard
quaint mantle
#

100 is 4

#

since 4 is a power of 2

wet breach
#

No i remembered them being bit masks for values so 2,4,6,8

sterile axle
#

there i fixed that now

wet breach
#

But doesnt surprise me they changed though

#

Mojang likes changing everything

#

All well guess no bitshifting for that then lol

quaint mantle
#

6 isn't a power of 2, yeah

lost matrix
#

Ah maybe it was a grey code

quaint mantle
#

It's 1, 2, 4, 8, 16, 32, etc. Each bit represents a power of 2.

lost matrix
#

Yeah but why? Makes no sense because we dont have many flags but just a simple enumerated value

quaint mantle
lost matrix
#

Im talking about why it would be a bit mask in the first place

quaint mantle
#

Maybe there was plans to mix gamemodes, or gamemodes were setup differently internally. Nobody (but the people who made that system) can say for sure.

tender shard
#

it was probably always just 0, 1, 2

quaint mantle
#

Maybe, I don't know. I haven't really looked into how Minecrafts netcode works, when I write my code, I just accept the fact that (in most cases) it does.

wet breach
#

But you get the idea anyways

wet breach
quaint mantle
tender shard
#

well it'd be the same, it's a "byte"

quaint mantle
#

Strings are also useful for networking, since every machine is different strings are probably the safest (if not a little bit expensive) way to send and receive information.

quaint mantle
kind hatch
tender shard
wet breach
sterile axle
tender shard
sterile axle
#

it says it right in the description

kind hatch
sterile axle
#

or if they haven't changed gamemodes before

tender shard
#

i wonder why the previous gamemode would matter in the first place

#

like, why

sterile axle
#

it looks like a potentially optional field, only used in the debug panel

#

so if you dont want to share it, just send -1

#

which is fine

tender shard
#

why does it not keep track of yesterday's time, or last week's health, why only previous gamemode

sterile axle
#

cause that's not shown in the debug panel?

tender shard
#

yeah but that exactly is my question

#

why the heck does the debug panel show my PREVIOUS gamemode

tender shard
#

that is true

kind hatch
#

Wait, has the debug menu started showing that information?

tender shard
#

I still wonder who thought "ah yes, lets show the PREVIOUS gamemode, that might be useful to some people... yesterday"

#

who decided that haha

quaint mantle
#

I think minecraft stores previous gamemodes because there is a shortcut key to swap gamemodes back and forth

tender shard
#

there is?!

kind hatch
#

There is and that's what it's used for

tender shard
#

there is a key to swap gamemodes? o0

wet breach
kind hatch
#

Hold F3 + Tap F4

sterile axle
#

so it would be -1 when the gamemode has never been changed, which is why it's a signed byte

tender shard
wet breach
#

Not necessarily

sterile axle
#

make a plugin that collects random animals if you're holding a certain item, then makes them follow you around when you type a certain command i guess 🤷‍♂️ good practice if nothing else

wet breach
#

But anyways we probably shouldnt infer too much when it comes to mojang code because as what simple said they dont always make sense in the why

kind hatch
#

@tender shard This is what the switcher looks like.

tender shard
#

does it need to be useful?

quaint mantle
#

I thought there was

tender shard
kind hatch
#

Yes, it's in Java

tender shard
#

never saw that

kind hatch
#

It's been in the game for a couple updates now.

kind hatch
quaint mantle
#

Ah, so then that doesn't actually answer why the previous gamemode would need to be stored.

kind hatch
#

It's for quick switching. I love it.

#

It's so useful for creative to spectator.

tender shard
#

make a plugin that when you send a message like "this is a sentence", it shows it as separate messages per word, like
mfnalex: this
mfnalex: is
mfnalex: a
mfnalex: sentence

rotund ravine
kind hatch
#

Just tap the keybind once to switch quickly

#

The weird thing is that I think it's per server.

quaint mantle
tender shard
#

no the list is always the same

kind hatch
#

No, it just moves the selection cursor to the previous gamemode you had before it will continue to cycle.

tender shard
#

but it selects your previous gamemode

#

^

#

like shadow said

quaint mantle
#

Ah, I see

#

Ok that makes sense then.

rotund ravine
#

F3 + N: Cycle between Spectator mode and the previous gamemode. Switches to Creative mode if there is no previous gamemode. Requires cheats to be enabled.

wet breach
#

Cheats for single player

tender shard
#

having cheats enabled in single player is sooo stupid

#

like "oh I need some dirt. well I COULD go back to my base and get it, I'Ll just /give it to myself right now, then remove it from the chest later" said nobody ever

#

and then one keeps cheating the whole time lol

lost matrix
#

It has been a long time since ive actually played this game...

tender shard
#

same

#

I play it usually for a week when a new version comes out

lost matrix
#

Same. Kind of. I have a german stream who has an event every time a new version comes out and im
providing the server/plugins for that. I play in the opening days when we have 50-100 players and then
i get bored

#

But modded i can stay interested in a bit longer

quaint mantle
#

what is the farthest distance an arrow shot from a bow or crossbow could travel??

lost matrix
#

At least 5

quaint mantle
#

at most?

lost matrix
#

A bit more

quaint mantle
#

i require an exact measure of the upper bound.

#

for something i am working on.

lost matrix
#

We need more constraints. Max distance is achieved by a 45° angle.
But if the arrow lands below the height it was shot from then it will fly further.
Are we speaking about a perfectly flat area?

quaint mantle
#

yep.

#

the highest distance it can travel, shot from build height to bedrock.

lost matrix
quaint mantle
#

hm

paper venture
#

If I check every mob in the world for meta data every tick, will it affect the performance?

quaint mantle
#

but that depends on how many chunks you set as simulation distance in the world folder.

round finch
#

Interesting math

quaint mantle
#

and there could be other players around.

quaint mantle
#

that could be loading chunks in that direction.

paper venture
quaint mantle
#

yeah.

#

depends on the number of mobs.

round finch
#

Just run the test and shoot an arrow

lost matrix
quaint mantle
#

to be more precise.

onyx fjord
#

Depends how much you do

#

Or how heavy it is

paper venture
#

just checks for a value in persistent data container

quaint mantle
#

you can run it an async thread.

lost matrix
onyx fjord
quaint mantle
#

to make sure it does not affect performance on the main game thread.

paper venture
#

yes

onyx fjord
#

Idk if you could add caching to it

lost matrix
paper venture
quaint mantle
#

using Bukkit.getScheduler().runTaskAsynchronously();.

#

BukkitRunnable is just a lambda.

#

you gotta pass that lambda into the function.

onyx fjord
#

What pdc item are you storing? Maybe it doesn't need to be like that

quaint mantle
#

for it to run.

lost matrix
#

Usually you would separate the lifecycles of your data:
Entity loads -> load from PDC into data structure (Map<UUID, SomeEntityData>)
Entity unloads -> save from data structure back into PDC

kind hatch
quaint mantle
#

this is annoying

#

lets just assume player is stationary.

#

anyway, i have this database where i store permissions for the player per chunk.

#

and i am loading and caching chunks around the player.

#

i am not sure how much to cache though.

#

so a player fires an arrow in some random unloaded chunk, there has to be a database query running on the main game thread to check if that row exists.

lost matrix
#

What are you trying to achieve?

quaint mantle
#

because events cannot be cancelled asynchronously, probably.

paper venture
#

I want to each attack add a stack of slowness, up to 3 stacks, but I thought that in my plugin there would be a lot of slowness reasons so to separate them I make attacks add attribute modifier and add a INTEGER tag to PDC, this tag decreases every tick and if it is 0, then I remove attribute modifier

quaint mantle
lost matrix
quaint mantle
#

something like that, yep.

lost matrix
kind hatch
quaint mantle
#

thought that would be more efficient than loading permissions for every loaded chunk for every player online on the server.

#

that would take up M*N time and space.

#

eh

#

too much off a hassle.

#

i was just thinking about this in terms of edge-case anyway, probably won't be too bad.

paper venture
lost matrix
#

This means your data is now player scoped and not chunk scoped. That sounds like a very questionable idea
if you want to protect the chunks and not the players.

lost matrix
paper venture
#

Thanks!

kind hatch
tender shard
#

/shrug if you ever only will need one instance, might as well make everything static

lost matrix
# tender shard one

Just to make sure bc i dont wanna read "why does my map in x not contain the stuff i put in y" again

paper venture
quaint mantle
#

there can be more than one player trusted to a chunk

kind hatch
lost matrix
quaint mantle
#

its a bit complicated so, if a player is trusted, it has all the permissions.

paper venture
#

Yes, these managers will be completely different types. Maybe I should consider making a manager generator if it is possible...

quaint mantle
#

but there are global permissions

#

for untrusted players.

tender shard
kind hatch
tender shard
#

"enterprise" java code is usually a big joke

quaint mantle
#

if a player is trusted to that chunk or the global pvp permission for that chunk is enabled, or the chunk is unclaimed, the damage from the projectile is not cancelled.

#

its a bit complicated to explain in words, i will just show some pictures.

tender shard
#

they also used fuzzy logic for EVERYTHING

kind hatch
quaint mantle
#

i am currently storing the data, yep.

#

in a database.

lost matrix
#

Its basically:
unclaimed -> fallback
== claimed
== trusted -> allow
== untrusted -> deny

fallback -> global default

quaint mantle
#

claimed (global pvp enabled) -> allow.

#

is how that is set up.

#

i mean

#

its a pretty standard chunk claims plugin.

#

global permissions.

#

anyway

kind hatch
#

That looks like permissions for the claim, not global pvp perms.

quaint mantle
#

i think the server just has to deal with the sql query lag.

#

yeah, permissions for the claim, globally.

#

for all players.

#

that are not trusted to that claim.

lost matrix
#

Anyways lets go through both approaches.
Lets assume that you give each player a LongSet and simply load all trusted chunks when they join.
On average a player may have 100 chunks assigned to them (which is a lot 1600 x 1600 size)
which means we have to allocate 100 * 64 bit which comes down to 6400 bit = 6.4kBit
A very good server can hold a max of 100 concurrent players which means you need to
Allocate 100 * 6.4kBit = 640kBit which is around 0.6MBit. Add maybe 2MBit for all the
data structure headers and a bit extra which comes down to maybe 3MBit or half a MByte.
So do you think you can spare a few megabytes?

quaint mantle
#

i can do that

tender shard
#

I'd just use the chunk's pdc to store "who's the owner of this chunk"

kind hatch
quaint mantle
#

and that is why i came here to ask

#

i am not sure about idea of M*N time and space complexity.

lost matrix
quaint mantle
#

loading trusted data for every player.

#

and no, i dont how many claims players may have

#

may be 100 or maybe 1000, idk lol, i am not using this plugin.

#

so i dont wanna load too much stuff.

lost matrix
lost matrix
tender shard
#

wtf

kind hatch
#

Please, I implore you to setup a server and see it crawl to its knees once 50+ try and join.

tender shard
#

I had a tiny Ryzen 5 3600 a year ago, using 1.19.X (whichever version was recent about a year ago) and I got about 30 concurrent players withOUT a pregenerated world, they were flying around with elytras and stuff, with solid 20 TPS. So I doubt that "100" is the limit

quaint mantle
#

what was the render and simulation distance?

tender shard
#

12

#

or 16? definitely NOT below the default limit

#

I don't remember it but I definitely raised it, or not changed it at all

quaint mantle
#

i currently have an smp and it definitely struggles with more than 11 players.

#

in terms of TPS.

lost matrix
#

We used a Ryzen 3600 for our last event and i even pregenerated the whole map. I optimized the jvm params
and limited a lot of the common cpu hogs like entity limit and hopper actions etc. Everything above 65 got us a tick average of 40ms which is a soft limit

tender shard
quaint mantle
#

although it runs fabric with lithium, starlight, ferritecore, and all those sorts of mods.

#

its a vanilla smp.

tender shard
lost matrix
#

Only one plugin i wrote myself which was optimized for this. (Didnt even show up in the 1% timings )

quaint mantle
#

instead of chunk scoping it, why not just load chunks in a certain distance of the player?

#

this way i dont have to load 1000 chunks, in case the player may have that many claims.

tender shard
#

anyway, it's definitely possible to have more than 100 players on one server, I've worked for ElderCraft when they still had about 300~ consec players daily, and they also ran everything off one dedicated machine (however that was 1.16/1.17 times)

quaint mantle
#

which is why i asking the maximum distance an arrow can travel.

lost matrix
quaint mantle
#

why would it be error prone?

kind hatch
lost matrix
buoyant viper
#

if u cheat, it could possibly be infinite AbsoluteHalal

quaint mantle
lost matrix
#

And thats just the first thing i came up with. Players can be vile

quaint mantle
#

when i said i am loading chunks around a player, i am not loading them around the player exclusively

#

player may have a chunk loader then running a tnt duper

#

or something like that

#

which is why i cache them as well.

#

or something idk, i will get back to working on it

#

enough procrastination.

kind hatch
lost matrix
quaint mantle
#

the cpu usage is not affected

#

actually, it is affected if i am loading M*N chunks where M is the number of players online and N is the number of chunks loaded throughout the server.

lost matrix
#

Speaking of loading things out of a database on the main thread when a chunk loads: Where is Redempt? Didnt see him recently.

tender shard
quaint mantle
tender shard
#

the awareness tag in plugin.yml

kind hatch
#

tf? What does it do?

buoyant viper
#

isnt it a very not necessary and/or deprecated tag

kind hatch
#

I've never even heard of that tag before so that's why I'm confused.

tender shard
#

but it still shouldnt cause problems

buoyant viper
#

ive seen it a total of one time, mentioned here, in this discord

#

@kind hatch

#

:v

tender shard
#

when I made that plugin, this tag was still mentioned in the official spigotmc wiki article about plugin.yml

#

meanwhile, it's not there anymore

#

but it should still not fail to load, after all yamllint.com tells me it's valid yaml

kind hatch
#

Oh wait

tender shard
#

2021, last update 2022

kind hatch
#

Was it that weird flag that was used internally?

#

Like PluginAwareness.Flags or some shit?

tender shard
#

yes

#

probably paper removed it again, calling this "api improvements" lol

rotund ravine
#

Makes sense

kind hatch
tender shard
#

yeah it is deprecated

#

but it's not removed

#

the whole flag was totally useless anyway, iirc. still it's weird to just remove it

kind hatch
#

Well if it is functionally useless then I don't see why you should keep it around, but that's just me.

tender shard
#

I am also going to remove it, I just wonder why it fails to load in paper

kind hatch
#

Does paper ever update the snakeyaml dependency?

tender shard
#

i don't know what they do

kind hatch
#

Could be an outdated one trying to read a new format.

#

Or a new one that dropped that syntax

tender shard
#

well it definitely worked in paper when I released that plugin, after all I use paper myself sometimes

#

if they wouldn't have banned me from their discord, I could ask there, lol

kind hatch
#

Apparently it shows as null.
Guess its not that surprising since the value starts with an exclamation mark.

tender shard
#

it is still valid yaml, isn't it

buoyant viper
kind hatch
#

So, either put it in quotes, or don't use it at all.

tender shard
#

well, the identifier of the list is, but not the contents of that list, iirc

#

also I just checked it using paper 1.19.3 and it loads fine for me, very weird. no idea where the dude in the github issue got this exception from

#

it loads just fine for me lol

kind hatch
#

Yeaa, I thought it might have been used for data serialization.

#

Guess it just comes down to the interpreter.

tender shard
#

yeah I'll just remove it. I'm still confused about why it errors for them on paper 1.19.3 but not for me on latest paper lol

quaint mantle
#

nvm.

kind hatch
#

@tender shard It looks like spigot updates the snakeyaml dependency every so often. Version 1.30 was used for 1.18-1.19.2. Version 1.33 is being used for 1.19.3 and onwards for now. Paper probably followed suit. So maybe there was a change somewhere in those versions that had caused that error.

tender shard
#

yeah but in that case, it must have been an "in-between" thing because it works fine for me using paper build 420 o0

#

which is the latest

#

very weird

#

why does IntelliJ not support tabs on windows D:

#

this is so annoying

#

on mac it's just always one window

buoyant viper
#

YAML docs really are something, trying to look for stuff regarding ! brings me to "tags", idk wtf they r at all, but they show a syntax similar to urs as invalid

#

tags are also mentioned in snakeyamls error that user reported

tender shard
#

have you heard about their "placeholder" stuff?

buoyant viper
#

ive never used yaml in depth

#

i usually opt for json

tender shard
buoyant viper
#

oh aliases

#

i did read that in the spec sheet

tender shard
#

erm yeah

#

quite nice, I wish XML would support this

buoyant viper
tender shard
#

oh yeah

#

I think I wrote a blog post about this shit but never published it

buoyant viper
#

oh its anchors & and aliases *

tender shard
#

yeah the anchor is the definition, and the alias is the "reference to it"

#

whatever

buoyant viper
#

ye

tender shard
#

might as well have written "portugal" lol

#

"stop travelling through portugal, mr. trident, you can get to morocco instantly by plane"

buoyant viper
#

instructions unclear, trident was stolen in Detroit

tender shard
#

unfortunately, it gets stolen into the nether

quaint mantle
tender shard
#

yeah

#

fuck netherlands

#

their weed is also much too expensive

#

but they definitely do know how to properly fry fish (kibbeling)

#

I'd sell my left leg for some nice kibbeling right now

paper venture
#

Is there a way to get a list of only loaded entities? Or world.getEntities() already does so...

tender shard
#

that's already returning only loaded entities

#

I'd sell my right leg to be able to get a list of not loaded entities

paper venture
#

Haha thanks!

tender shard
#

np

quaint mantle
#

Imagine what magic would be required to get a list of something that technically doesn't exist until it's loaded.

tender shard
#

it's called MojangsonParser or similar lol

#

I use it to get the PDC of offline players for example

quaint mantle
tender shard
#

exactly

quaint mantle
#

There is still the issue of knowing which region files have unloaded entities without looping over all of them.

tender shard
#

usually all of them I guess

quaint mantle
#

That's a lotta entities

tender shard
#

yeah lol

quaint mantle
#

Are entities really that common? I guess bats, but I don't like the idea of every chunk in a world having at least 1 entity when it's seemingly empty.

#

Plus, don't entities that aren't persistent get effectively deleted once the chunk unloads?

tender shard
#

iirc, hostile or ambient mobs aren't even saved unless they have a custom name or anything

paper venture
#

Nice this code takes only 0.005 seconds to run so I can do some unoptimized stuff!

tender shard
#

if you run it twice, it probably takes less time

quaint mantle
paper venture
#

Yes, thats clear, I will try not to overload my TickTask for too much

hybrid spoke
#

just overdrive the ticks so you have more ms to fuck around dankfingers

quaint mantle
eternal oxide
#

Yes he was joking

hybrid spoke
#

but he got a point tho 🤔

#

just underdrive the ticks so you have more ms to fuck around dankfingers

eternal oxide
#

Use reflection to inject more ticks so you can take as much time as you like.

tender shard
eternal oxide
#

fixed

hybrid spoke
#

make your ticks negative so you have infinite ms

tender shard
eternal oxide
#

lol probably

#

I want my own private tick

tender shard
#

i remotely recall that there's a spigot plugin that allows you to change the tickrate, but it doesnt work on paper

hybrid spoke
#

yes there is

#

literally called "overdrive"

tender shard
#

oh yeah that one

chrome beacon
tender shard
#

modrinth? for spigot plugins?

chrome beacon
#

That's a Paper plugin

tender shard
#

haha

hybrid spoke
#

i like the FAQ

tender shard
#

I like how paper shot it's own leg by inventing this stupid "paper-plugin.yml" thing

chrome beacon
#

hm how so?

tender shard
#

because it makes plugins not be compatible with spigot anymore?

#

if someone only uses the paper-plugin.yml thing

chrome beacon
#

You can have both a paper yml and a spigot yml

tender shard
#

you can, but people won't

mighty pier
#

😱

tender shard
#

they will read exactly one tutorial, and only parts of it, then they'll continue to just provide this paper file, and then they'll be confused about "why it's no workings on spigot uuuuh"

chrome beacon
#

If people want to make spigot plugins they'll just continue to do it like normal

tender shard
#

in a perfect world, this would happen

#

in a perfect world though, paper could just have used the same .yml file to add their additions

#

or, even better: just contribute upstream

chrome beacon
#

If people misunderstand that the paper-pluign.yml is only for paper then that's not papers fault

tender shard
#

they want you to include 2 yml files?

chrome beacon
#

You're free to choose

#

You don't need the Paper one

tender shard
#

and I said that people will not understand this because nobody ever reads a tutorial completely, and that's why it'll cause problems

remote swallow
#

Loads of spigot plugins broke on paper bc of their paper-plugin

tender shard
#

it's usual for paper to break stuff, e.g. them fixing tnt duping by default is already kinda stupid imho

#

it should be an OPTION to fix this, not a DEFAULT

#

oh also the API incompabilities, e.g. remember when AdvencementInfo broke after spigot added that? And then plugins using the existing paper api ofc all broke down because Paper decided they must return a component instead of a string. If they would just contribute upstream, there'd be literally no problems lol

#

i never understood why everyone's so afraid to sign a tiny cla that only consists of like 2 pages

#

I also further have to add that paper adds many useful things, like way faster chunk loading and stuff

#

but the whole idea of "moving away from spigot" is a bit stupid imho

eternal oxide
#

Most don;t like having to provide personal info

hybrid spoke
#

we gotta make spigot more performant so people stay with it

tender shard
eternal oxide
#

personal info handed out to who knows who is nto very safe

tender shard
#

my address is Junkerstraße 17 in 48165 Münster, Germany. My phone number is 015174202224. I could continue and tell you my iban. what is anyone going to do with such info?

remote swallow
#

Md is very sadlfe

#

Safe

tender shard
#

and as already explained, you only give that info to md_5, not to EVERYONE

eternal oxide
#

impersonate you and open credit in yoru name with enough info

remote swallow
#

^^

hybrid spoke
#

registering with your phone number on some scam site now

quaint mantle
#

Both ConfigurationSection.contains(section, true) and ConfigurationSection.isConfigurationSection(section) appears to be returning true for a field that doesn't exist... Does anybody have an idea as to why this might be happening?
The section exists in the default config.yml but not in the data folder one.

tender shard
hybrid spoke
#
  • sending you elefant shit to your home
eternal oxide
#

thast the point, You don;t actuall yknow who has access to that information. Everyone assumes it's only md5

tender shard
hybrid spoke
#

ever happened?

tender shard
#

they can just open "google earth" and scroll to a random place, then check the address

tender shard
hybrid spoke
#

so i will be the first

eternal oxide
tender shard
#

there are literally NO details that I am hiding besides my reddit username and my banking pin

eternal oxide
#

any that yoru carrier has. They can also get your phone spoofed

tender shard
#

wdym with "spoofed"?

eternal oxide
#

It happens often

remote swallow
#

Why hide reddit username eyes_sus

tender shard
#

and I dont want spigotmc people to see them

remote swallow
eternal oxide
#

they clone yoru phone and basically get all texts you send/receive

hybrid spoke
#

spoofing your phone number to get your reddit username

tender shard
#

I dont know how calling works but I am pretty sure that the number you call can see the actual phone number

eternal oxide
#

its very common way of hacking 2fa

tender shard
#

idk my ubikeys are safe and sound in a drawer and have never been hacked

eternal oxide
#

yet

remote swallow
#

We have your address

eternal oxide
#

Thats the thing about personal info, once enough of it gets out there the more you become vulnerable

remote swallow
#

We just break in and take them

tender shard
eternal oxide
#

and breakign in becomes quite easy, often with just a fishing rod

tender shard
#

if anyone would actually be afraid of their "personal data", they wouldn't use discord

#

which is erm, quite known to ignore the GDPR and sell data to everywhere

wet breach
eternal oxide
#

I gave no personal info to discord

eternal oxide
#

however I did sign the cla

tender shard
#

nobody can tell me that "randomPaperContrib" doesnt want to sign spigot's CLA because "I'm afraid of giving away personal info" but then continues to talk on their discord server haha

hybrid spoke
#

well. im not a fan of publishing my private info but a CLA of a verified longyear-standing project is something else

tender shard
#

also, md doesnt even check which data you put into the CLA. you could just enter some random address

eternal oxide
#

you could but it's also on Google servers

tender shard
#

what is on google's servers?

eternal oxide
#

as it uses Google to authenticate

tender shard
#

?cla

undone axleBOT
eternal oxide
#

when you signed the cla it was via google

wet breach
#

As if google didnt already have personal info

tender shard
#

but everyone's data is already on google anyway

#

I really never understood the idea of everyone now saying "lol I don't want my data being on google"

eternal oxide
#

perhaps perhaps not, it's still a reason people are reluctant to sign it

#

I had to think twice before I signed

wet breach
#

I didnt think twice

buoyant viper
#

i kept the tab for a lil while before i finally signed off on it

eternal oxide
#

You young'uns throwing caution to the wind

wet breach
#

Google knows where i live and i am forever in the library of congress

buoyant viper
#

kinda forget now if i signed off with my legal name or my to be legal name

tender shard
#

yeah and it's a reason that I do not understand, and also it adds a huge downside to paper:

it might be taken down anytime. someone could just message github and claim "yo that's my code": then they proceed to send a tiny fracture of code that's actually similar. Then github asks the owner of paper's repo "yo, is it true that you stole it?" then they reply:

...

what do you think? spigot could reply
"The dude who pull requested this code promised to me that he wrote it himself, here's the signed PDF:"

paper would have to say:
"erm idk"

wet breach
#

Unless the library of congress burns down again

tender shard
quaint mantle
#

How to play an animation for a player with plugin (animation aldready in client's resource pack)

quaint mantle
#

like custom animation for player, can spigot plugin send packet that play an animation in client side?

tender shard
#

I still don't know what you mean with "animation"

quaint mantle
#

like run, walk, swing arm etc... you know, player's character's animation

tender shard
#

ah ok

#

for "swing arm", there's api for that, yes

#

run, walk, i am not sure, but I dont think you can do this using spigot API, you'd probably have to use NMS

quaint mantle
#

anyway, what is the way with "swing arm"

tender shard
#

swingOffHand() also exists, ofc

pseudo mica
#

Hi, I have a public chat on redis and a guild chat(private) on bungee, someone knows how to block the chat packet when someone write in the bungee chat because right now when you write in the bungee chat the message appears also in the public one 😦 ?

tender shard
#

whut

#

a "public chat on redis"?

pseudo mica
tender shard
#

yeah I am just confused of you calling it "public"

#

does everyone know your redis password, or what o0

pseudo mica
tender shard
#

I asked "why" because you said "public"

pseudo mica
tender shard
#

oooh

#

lol ok

hybrid spoke
#

so you want to do some sort of cloud system where you sync messages across servers via redis or what

pseudo mica
tender shard
#

well, how the chat is interpreted depends on the plugins you already use. by default, the proxy only forwards the chat packets to the server where the player (receiver, AND sender) actually is on

#

if you see the same message twice, you installed some plugins which caused this problem

#

by default, chats are always "per-server"

hybrid spoke
#

bungee has a chat?

tender shard
#

no

hybrid spoke
#

was about to say

tender shard
#

it just forwards the existing packets

#

if they see messages twice, they already use some plugin

#

if you'd remove all plugins, I'm sure this wouldn't happen

pseudo mica
#

Is not possible to block the packet after sending over bungee?

tender shard
#

I really don't understand what you're talking about

#

if you could explain it again in a bit easier words, maybe I could understand it

tender shard
#

I would however never recommend ProtocolLib, it's a pain

pseudo mica
#

So, I write in chat and the message is sent over redis to every other server. When I turn on the guild chat it sends the message over bungee but also in the redis

chrome beacon
#

ProtocolLib isn't that bad

#

You just need to learn how it works and then it's fine

tender shard
tender shard
#

it promises to be cross-version but actually all it does is like "getIntegers()" and then you still gotta care about "which integer" is "which"

#

imagine this:

#
public class MyExamplePacket extends Packet```
chrome beacon
tender shard
#

how is protocollib gonna handle that? oh right, it doesn't. you are supposed to do this on your own

#

and that's why I think that protocollib is nothing but a joke

#

I might be wrong of course, and maybe I simply misunderstood something

tender shard
#

all it does is to abstract the classes even further. so instead of doing

new PacketExample(1,2,3);

people now do this:

PacketExample ex = new PacketExample();
ex.getIntegers().set(0,1);
ex.getIntegers().set(1,2);
ex.getIntegers().set(2,3);
#

seems a bit useless to me, but ok

#

maybe it once was useful, idk

#

why would anyone want to do this instead of just calling the proper constructor of that packet

wet breach
tender shard
#

but they do

#

they literally say "set the first "int" field in the constructor to 1"

#

cant get any worse than that imho

#

this PacketWrapper thing on github was a proper approach but yeah

#

it died

wet breach
tender shard
#

that's also what I'm talking about

wet breach
#

Well you dont need nms or reflection if you are using protocollib otherwise pretty useless to use the lib

quaint mantle
wet breach
#

?stash

undone axleBOT
quaint mantle
tender shard
orchid gazelle
#

I use BuildTools -> target > decompiled for viewing sourcecode

tender shard
#

protocollib is sooo useless in my eyes

orchid gazelle
tender shard
#

then check that

tender shard
orchid gazelle
#

A Jägermeister a day keeps the doctor away

tender shard
#

I'll need some bencodiacepines to survive this day anyway

orchid gazelle
#

Oh yes same

tender shard
#

rivotril high five

orchid gazelle
#

I got holidays this week and got sick on monday yikes

tender shard
quaint mantle
buoyant viper
#

craftbukkit is the implementation of bukkit api for minecraft

orchid gazelle
tender shard
#

I explained it above

buoyant viper
tender shard
#

exactly

buoyant viper
#

unless its a reeaallllyyy generic packet like chat, payload, or maybe player movement

#

something less likely to change or be removed

orchid gazelle
#

You really need some Jäger to not die while porting Version-Dependent stuff

tender shard
#

I doubt that, the NMS classes change all the time. and if they really "wouldn't change", then one could easily just provide a wrapper for each class

tender shard
tender shard
#

just google "alcohol withdrawahl symptoms" if you care

orchid gazelle
#

Ok

buoyant viper
#

i remember trying to port some old ass simple forge mod to a modern version

orchid gazelle
#

Ouch

buoyant viper
#

and between mapping changes and literal code changes (ie. Gui handling), it was aids

orchid gazelle
#

Forge porting is 10x worse than plugin porting

#

And plugin porting is already insanely painful

buoyant viper
#

it was like 1.7 mod ported to 1.13 or 1.14

orchid gazelle
#

Even worse

#

Its literally a completely different modloader lol

tender shard
orchid gazelle
#

Im using mojang mappings nowadays

#

Imma hope porting gets easier with that from now on

quaint mantle
#

what best app to decompile plugin jar file to view source code

orchid gazelle
#

lmao

#

Alex with the blog post for everything

tender shard
#

I am just tired of answering the same questions every day, again and again

#

like for example "lol how do I make custom heads"

#

or "uuugh how do I tell maven to output my .jar to C:\MyServer\plugins"

orchid gazelle
#

Keep it up bro

#

Ah yes Alex btw. I found the issue why the multiblocks lag

tender shard
#

what is multiblocks?

orchid gazelle
#

The schematic thingy you know

tender shard
#

I knew it? I don't recall that

quaint mantle
#

what should i do, i just clone craftbukkit and open with intellji Could not find artifact org.spigotmc:minecraft-server:jar:1.19.3-R0.1-SNAPSHOT in minecraft-libraries (https://libraries.minecraft.net/)

orchid gazelle
#

Nono I mean I know how to fix it

tender shard
#

you have to run buildtools

#

?bt

undone axleBOT
orchid gazelle
#

Thing is that the stupid client inits, wipes, inits, wipes the light-chunks everytime

#

So what I gotta do is init them one time and keep them there by faking like a barrier block so it does not keep wiping it

lost matrix
#

is "minecraft-server" actually an artifact?

#

I guess it is

quaint mantle
#

what actually is "artifact", i see it but i dont understand it

buoyant viper
#

artifact would be like the jar

lost matrix
#

An artifact is just a piece of software. In the maven context its mostly a compiled jar.

cold field
#

Does anyone have a github-action that when there is a release it publish the artifact even on spigot?

tardy delta
#

me wondering how people understand how to work with github 😢

stiff snow
#

Sry but can anyone help me?
I created a list with following command List<PotionEffectType> effects = Arrays.asList(PotionEffectType.values()); and now i try to remove some effects
with following commands ```java
List<PotionEffectType> removeeffects = new ArrayList<>();
removeeffects.add(PotionEffectType.REGENERATION);
removeeffects.add(PotionEffectType.FIRE_RESISTANCE);
removeeffects.add(PotionEffectType.DAMAGE_RESISTANCE);
removeeffects.add(PotionEffectType.INVISIBILITY);
removeeffects.add(PotionEffectType.WITHER);
removeeffects.add(PotionEffectType.INCREASE_DAMAGE);
effects.removeAll(removeeffects); <== ERROR HERE

but i got this error message in the console
lost matrix
#

Arrays.asList returns an immutable List. Use a normal ArrayList instead.

tardy delta
#

new ArrayList<>(Arrays.asList(...))

lost matrix
tardy delta
#

Lists.newArrayList(...) kek

smoky oak
#

Is there a resource that explains how permissions with numeric values work? The problem i have is that something.<number> says the player doesnt have the permission something

eternal oxide
#

something does not equal something.<number>

#

if you give a permission something.1 they will not have something

smoky oak
#

how do plugins do it then?

#

allow everyone access to the command and then check if they have the permission?

eternal oxide
#

you specify child nodes

#

if you want someone to have something you have to actually give that permission. They don;t get it when you give something.1

#

a permission does not understand .

smoky oak
eternal oxide
#

thats just another character

#

ie something.1 is a permission, it is not something and 1

smoky oak
#

i see

#

still

#

what do you mean by child nodes

eternal oxide
#

in your plugin.yml you can specify parent/child nodes

smoky oak
#

i cant just go and say something.1 child something, something.2 child something, something.3 child something

#

that would defeat the whole purpose of doing it numerically

eternal oxide
#

if you want them to require something to use a command you have to actually grant that node

#

then you can check for something.x in the command

smoky oak
#

ig

heady pumice
#

MapView.Scale doesnt seem to be working for me when i create a Map via server.createMap.
I apply the view via MapMeta toa FILLED_MAP, which works fine, scale just isnt reflected.
Do i need to set anything additionally via the meta? No matter what scaling i set in the MapView it just doesnt seem to work

#
sender.server.createMap(sender.world).also { mapView ->
    mapView.scale = MapView.Scale.FARTHEST
    mapView.isLocked = true
    mapView.addRenderer(ImageMapRenderer(image.getScaledInstance(2048, 2048, 0)))

    ItemStack(Material.FILLED_MAP).also { item ->
        item.itemMeta = (item.itemMeta as MapMeta).also { meta ->
            meta.mapView = mapView
            meta.isScaling = true
        }
        sender.inventory.addItem(item)
    }
    sender.sendMap(mapView)
}
#

The ImageMapRenderer literally just calls canvas.drawImage, not sure if i need to set anything in there additionally

#

okay so the scale is set right in the Item, but rendering doesnt seem to adjust in the drawImage function

paper venture
#

Is there a way to understand if a player is hidden for another player?

tardy delta
#

Player#canSee iirc

smoky oak
#

can you test if a string is an integer without using try/catch

#

like a simple way i dont want to throw a regex at it

tardy delta
#

loop thro each char

smoky oak
#

so regex got it

tardy delta
#

thats not what i said

smoky oak
#

its essentially the same isnt it?

tardy delta
#

the only dif is that regex is slow

#

but ye your choice

paper venture
smoky oak
tardy delta
#

dunno what that means

smoky oak
#

like flags?

#

i know that regex can check strings backwards

#

but not how

hazy parrot
#

what

#

if you want to check if its number with regex just \d*

#

but tbh idk why wouldn't you use try/catch

#

its surely faster then regex

smoky oak
#

what about this one?

if(!new Scanner(strings[1]).hasNextInt()) return false;
int number = Integer.parseInt(strings[1]);
tardy delta
#

a scanner on a string?

smoky oak
#

thats how console input works aint it?

tardy delta
eternal oxide
tardy delta
#

there isnt a a constructor that takes a string

hazy parrot
smoky oak
#

wtf

hazy parrot
#

tbh just use try/catch

smoky oak
#

no im like

#

how is that faster

hazy parrot
smoky oak
#

im assuming that coreJava is the try catch thing?

hazy parrot
#

yap

smoky oak
terse ore
#

Is it possible to have more than 2 world borders in a single world?

smoky oak
#

i believe with 1.19 world borders are now per-player but still restricted to 1

#

its like a really recent change

#

might be in the snapshot im not sure

hybrid spoke
#

but why would you need 2 borders

hybrid spoke
#

either per player (whatever moterius said via api) or via packets

terse ore
smoky oak
# hazy parrot what

oracle docs:

A compiled representation of a regular expression.
A regular expression, specified as a string, must first be compiled into an instance of this class. The resulting pattern can then be used to create a Matcher object that can match arbitrary character sequences against the regular expression. All of the state involved in performing a match resides in the matcher, so many matchers can share the same pattern.

A typical invocation sequence is thus

 Pattern p = Pattern.compile("a*b");
 Matcher m = p.matcher("aaaaab");
 boolean b = m.matches();
A matches method is defined by this class as a convenience for when a regular expression is used just once. This method compiles an expression and matches an input sequence against it in a single invocation. The statement

 boolean b = Pattern.matches("a*b", "aaaaab");
is equivalent to the three statements above, though for repeated matches it is less efficient since it does not allow the compiled pattern to be reused.
Instances of this class are immutable and are safe for use by multiple concurrent threads. Instances of the Matcher class are not safe for such use.
terse ore
#

they use different borders for every skyblock island

hybrid spoke
terse ore
#

I would like to make something like that

terse ore
hybrid spoke
#

oh you mean that many islands are in one world and each player has his own border?

#

okay yeah, thats just per player

terse ore
#

Is it possible to make in 1.19?

#

or is it an older version feature

smoky oak
#

btw cipher? do worlds run all on the same thread? i always forget

hybrid spoke
hybrid spoke
hazy parrot
smoky oak
#

k

hazy parrot
#

well, i didn't sent url

#

they basically do

smoky oak
#

@tardy delta ur opinion

private boolean hasPermission(final Player player, final int checkValue){
        Optional<String> permString = player.getEffectivePermissions().stream()
                .map(PermissionAttachmentInfo::getPermission)
                .filter(e -> e.toLowerCase(Locale.ENGLISH).startsWith("permission."))
                .findFirst();
        if(permString.isEmpty()) return false;
        try{
            int permValue = Integer.parseInt(permString.get().substring(10));
            return permValue >= checkValue;
        }
        catch (NumberFormatException e){
            player.sendMessage("Please input a valid number.");
            return false;
        }
    }
#

also im open to suggestions lol

tardy delta
#

remove those finals, this is not C++

smoky oak
#

that aside

tardy delta
#

no

smoky oak
#

we both know thats not what i asked

#

'what would you do differently aside from the final keywords' if you need it spelled out

tardy delta
#

could use Optional#map but that wont change anything

smoky oak
#

i mean if people give the same permission with different numbers thats not my problem

#

but point

tardy delta
#

ig that loops thro the players permissions and checks for a permission.X with X higher than checkValue?

smoky oak
#

yuo

#

*yup

#

also im checking all perms

#

cuz of inheritance

#

thats what im changing rn

tardy delta
#

assuming you dont fuck up with the permission.X i dont see a reason for that try catch

eternal oxide
#

effective permissions on teh player is ALL perms the player has, excluding wildcard

tardy delta
#

let the permissions expert help

eternal oxide
#

unless using Vaul#playerHas for permission checks

smoky oak
eternal oxide
#

you should support vault if it's there

#

its the defacto permission interface

grim oak
#

Dk if this is the right place to ask this, but where and how could I look for work as a plugin developer. How can I find service kind of places to work, and what evidence of experience, and how much of it would they expect to see, and could it also be more beneficial to just work on my own and publish plugins to Spigot?

lost matrix
#

?services

undone axleBOT
grim oak
#

Thanks

river oracle
#

Hey I was about to do that

smoky oak
#

its a bit restrictive tho

#

you have to have some published stuff iirc

eternal oxide
#

published?

smoky oak
#

an account with at least 20 posts

river oracle
#

You need a few forum posts to post in the section is all

smoky oak
#

im not a forum person

#

so i still dont fulfill that

river oracle
#

Can always go yo those who are looking for developers

tardy delta
#

💀

river oracle
#

And contact em

smoky oak
#

i mean i have like 9000 chat messages here but like 0 forum posts on spigot

tardy delta
#

just post every day "hello world"

river oracle
#

Or be helpful just 20 times 💀

smoky oak
#
List<String> permList = player.getEffectivePermissions().stream()
                .map(PermissionAttachmentInfo::getPermission)
                .filter(e -> e.toLowerCase(Locale.ENGLISH).startsWith("permission."))
                .map(e -> e.substring(10))
                .toList();
        if(permList.isEmpty()) return false;
        for(String p : permList){
            try{
                int value = Integer.parseInt(p);
                if(value >= checkNumber) return true;
            }
            catch (NumberFormatException e){
                getLogger().warning("Not a number.");
            }
        }
        return false;

opinion?

tardy delta
#

why streaming and then looping over it?

grim oak
smoky oak
#

might work actually

#

im not sure if try/catch can be used in a stream method call

tardy delta
#

you can put try catch in your map

river oracle
#

There is an hiring developer section

smoky oak
tardy delta
#

return checkVal - 1 if its not an int or smth, then filter the ones that are lower than checkVal out again

#
player.getEffectivePermissions().stream().map(p -> p.getPermission().toLowerCase(Locale.ROOT))
.filter(p -> p.startsWith("permission."))
.map(p -> {
  try {
    return Integer.parseInt(p);
  } catch (NumberFormatEx e) { return checkVal - 1; }
})
.filter(num -> num >= checkVal)
.findAny()```
smoky oak
#

ah

#

yea i need to make the block around it

#

what happens with findAny on an empty stream?

#

does it give an empty Optional ?

tardy delta
#

you probably want that method that returns if the stream found anything

gleaming grove
#

Does Spigot website provides some Rest API that can I use to update Description of my plugin?

tardy delta
#

i forgot the name

smoky oak
#

findfirst?

tardy delta
#

anyMatch

smoky oak
#

instead of filter then ig

tardy delta
#

no anyMatch will return if the stream contains any elements

smoky oak
#

ye i figured

tardy delta
#

so you filtered the ones out that are not permission.X and where X is lower than your value

smoky oak
#
.map(e -> {try{return Integer.parseInt(e);}catch(NumberFormatException ex1){return -1;}})
                .anyMatch(e -> e>= vaultNumber);
tardy delta
#

ah anymatch takes a function?

smoky oak
#

predicate

rotund ravine
#

🤮

tardy delta
#

im thinking if you dont need .count() > 0 instead lol

#

mb

smoky oak
# rotund ravine 🤮
return player.getEffectivePermissions().stream()
                .map(PermissionAttachmentInfo::getPermission)
                .filter(e -> e.toLowerCase(Locale.ENGLISH).startsWith("permission."))
                .map(e -> e.substring(10))//adjust depending on line above
                .map(e -> {try{return Integer.parseInt(e);}catch(NumberFormatException ex1){return -1;}})
                .anyMatch(e -> e>= vaultNumber);

full code for your viewing pleasure

#

actually i can remove one of those maps ig

rotund ravine
#

What are you even checking for

tardy delta
#

ye

smoky oak
#

permissions, namely numbered ones

#

in the style of permission.<number>in this example

#

or rather if the number is equal or higher to the number to check against

desert loom
hazy parrot
#
public static boolean canMakeMoreKeys(Player p){
        if(p.isOp()) return true;
        int maxKeys = Integer.parseInt(p.getEffectivePermissions().stream()
                .filter(perm -> perm.getPermission().startsWith("restful.count."))
                .map(perm -> perm.getPermission().split("\\.")[2]).findFirst().orElse("1"));
        return Main.getInstance().getDataContainer().getKeysCount(p) < maxKeys;
    }

This is how i done it in my like really old project

smoky oak
#

ah

#

i forgot about split

#

but how do you get around not calling try/catch? saying 'your fault' if someone tried to give restful.count.five?

lost matrix
#

Someone knows which event is fired when a falling block hits a torch? I know it was something absurd like the BlockPhysics event or something
but im too tiered to go through all the events.
Its for sure not:

  • EntityChangeBlockEvent
  • EntityDeathEvent