#help-development

1 messages · Page 1332 of 1

lilac dagger
#

ah

thorn isle
#

consider for example weights 0.9 and 1.0

quaint basin
#

this doesn't make sense so ig

#

because imagine

#

why u want votes?

chrome beacon
#

They just made it

thorn isle
#

you would assume 1.0 would be more likely than 0.9, right?

umbral ridge
#

jesus

#

XD

quaint basin
umbral ridge
#

this is for my friends

quaint basin
umbral ridge
#

all done internally

#

not public

#

the server is private

thorn isle
#

however, after being normalized, the weights will be 0.9/1.9 = 0.47, and 1.0/1.9 = 0.53

#

you will be rolling a random value from 0.0 to 1.0

lilac dagger
#

i think it's correct no?

thorn isle
#

getting the floor entry will result in you not finding any entry 47% of the time, getting the first entry 5% of the time, and getting the second entry 47% of the time

#

meaning the entry with weight 0.9 is 10x rarer than the one with weight 1.0

#

you can visualize this by drawing a line on paper from 0.0 to 1.0

#

and placing our entries on it as dots

#

the probability of pulling an entry will be the distance from its dot to the next dot

#

or if using ceilingEntry, its distance to the previous dot

#

this means that using just the raw weights rather than cumulative weights, the more similar are the weights of two entries, the less likely it is for one of them to be picked

#

in the most extreme case, if two entries have the same weight, one of them will never be picked, because the distance to the next dot is 0

#

tl;dr you need to use a cumulative weight

#

as is done here

#

this ensures that the distance from any given dot to the next dot is exactly its weight proportional to the total weight of all entries

#

in the example case of 0.9 and 1.0, the actual double keys you want in the map are 0.0 and 0.47

#

because then, from the uniform distribution of [0.0, 1.0), there is a 47% chance that picking a random spot on the line, the dot to its left will be the first entry; and 53% case that it will be the second entry

wet breach
#

someone knows their math. What you spoke about is similar to how some heuristics works in regards to determining some things especially in games

vagrant stratus
quaint basin
#

[21:04:13 INFO]: [TurboItemWorth] jump? true
[21:04:14 INFO]: [TurboItemWorth] jump? false
[21:04:14 INFO]: [TurboItemWorth] jump? true
[21:04:14 INFO]: [TurboItemWorth] jump? false

I press the Spacebar twice and I see 4 PlayerInput packets; 2 packets per key. I have this debug regardless of whether I'm in creative/survival mode. What I don't understand is why when I press the Spacebar once, the client sends the PlayerInputPacket twice

vagrant stratus
umbral ridge
#

thank you, can I use it in my plugin?

quaint basin
lilac dagger
#

i have to see why this works

lilac dagger
#

for anyone wanting to test it out 😄

#

this one works properly

#

as @thorn isle helped me 😄

vagrant stratus
lilac dagger
thorn isle
thorn isle
lilac dagger
#

hmm

young knoll
#

That’s similar to what I do

vagrant stratus
#

Yea, inventory population lol

thorn isle
#
public WeightedMap(Map<T,Double> map) {
  double totalWeight = 0.0;  
  double weightCumulative = 0.0;
  for (var e : map.entrySet()) {
    totalWeight += e.getValue();
  }
  for (var e : map.entrySet()) {
    treeMap.put(weightCumulative, e.getKey());
    weightCumulative += e.getValue() / totalWeight;
  }
}

public T roll() {
   return treeMap.floorEntry(ThreadLocalRandom.current().nextDouble()).getValue();
}
#

notice how the weightCumulative is updated inside the loop that builds the map

young knoll
#
public class WeightedRandom<T> {
    private final NavigableMap<Double, T> map = new TreeMap<>();
    private double total = 0;

    public WeightedRandom<T> add(double weight, T entry) {
        if (weight <= 0) {
            return this;
        }

        this.total += weight;
        this.map.put(this.total, entry);
        return this;
    }

    public T poll() {
        return poll(ThreadLocalRandom.current());
    }

    public T poll(Random random) {
        double value = random.nextDouble() * this.total;
        return this.map.higherEntry(value).getValue();
    }

    public Set<Entry<Double, T>> getEntries() {
        return Collections.unmodifiableSet(this.map.entrySet());
    }

    public Collection<T> getValues() {
        return Collections.unmodifiableCollection(this.map.values());
    }

    public boolean isEmpty() {
        return this.map.isEmpty();
    }

    public int size() {
        return this.map.size();
    }
}`’’
quaint basin
thorn isle
#

something like that, or maybe the client sends a packet for it

#

no, higher entry is not the issue here

#

the issue is that you're not incrementing the total in between adding to the map

vagrant stratus
#

Correction: It supported both vanilla LootTables & custom ones

umbral ridge
#

It supported OpticFusion and LootTables

lilac dagger
#

okay, this has to work right?

#

i understand now why my approach didn't work

thorn isle
#

now you no longer need the nested arraylist

#

since you change weightCumulative in every iteration, every key is guaranteed to be unique

lilac dagger
#

i assume all weights are different?

thorn isle
#

unless an entry has a weight of zero

young knoll
#

Yeah you gotta say no to 0 weights

thorn isle
vagrant stratus
#

It's genericized kekw

lilac dagger
#

it works 😄

lilac dagger
vagrant stratus
#

just learn math

lilac dagger
#

i am trying actually 😄

vagrant stratus
#

Everyone hates math, right? Wrong! I like math. Mathematicians like math, presumably. Physicists like math, usually. People who hate math just don't understand it. But like that weird ethnic food you're scared of trying, or that odd kid in class that doesn't say much, if you come to understand something it's not so scary. In fact, if we can lear...

▶ Play video
lilac dagger
#

in case anyone needs it

#

i have this guy in my playlist

thorn isle
#

isn't professor dave a fraud

#

i remember seeing some controversy recently but i didn't pay it much attention

lilac dagger
#

nah, the other way around

#

he exposes frauds

wet breach
thorn isle
#

something something not actually a professor

lilac dagger
#

i'm not sure

#

but what he says seems correct

vagrant stratus
#

If the videos are good that's the important thing

thorn isle
#

myeah fair

vagrant stratus
#

There's much more to worry about than a title lmfao

lilac dagger
#

i don't have only him in my playlist so he's not my only source

wet breach
thorn isle
#

don't need to be a professor to know math anyway

vagrant stratus
#

^

wet breach
#

in the US the only time you can't call yourself a professor is if you are using such a title to decieve people into thinking your employed by an institution

#

so I say, if you teach and know the subject well go right ahead and say you are a professor 🙂

wet breach
thorn isle
#

duke let's not maybe

#

i'll try finding where i saw that controversy later and seeing what ti was about

vagrant stratus
#

LET'S

vagrant stratus
lilac dagger
#

he says this on his profile:

wet breach
#

makes sense why they know math too lol

vagrant stratus
#

They teach a few different things actually

#

Physics, Latin, Mathematics, Pharmacology, Italian, Chemistry, Economics, and a few other things

quaint basin
chrome beacon
#

Just use the event

#

Directly listening to the packet won't make the delay go away

drowsy helm
#

player is sent a a 'Player Abilities' packet which tells the client if they can fly or not

#

then client determines the logic behind initiating fly

quaint basin
#

PlayerToggleFlightEvent event is just called if the player is on creative mode

#

and i need to listen if the player is on survival too

young knoll
#

You can setAllowedFlight in survival too

thorn isle
#

i recommend using the input event since that won't interfere with other plugins as much, and works better with latency

#

with the flight method, the client will think it is flying until the server replies to their flight toggle packet and disables it again, causing desyncs

young knoll
#

Yeah

#

The input event will require a bit more logic though

thorn isle
#

jump event + timer + onGround check should do it i think

chrome beacon
#

We don't really know what version they're on but yes that would also work

quaint basin
#

I'm on latest

chrome beacon
#

That's good, then you gave give the input event a try

quaint basin
#

I wouldn't want to use timers for this

chrome beacon
#

I already told you this

quaint basin
#

because a packet can take a while to arrive, etc

quaint basin
chrome beacon
#

It does

quaint basin
#

what is the packet

chrome beacon
#

Why do you want to listen to the packet

quaint basin
chrome beacon
#

As I mentioned earlier, listening to the packet won't help you

#

Use the event

chrome beacon
#

it is triggered by the packet

quaint basin
chrome beacon
quaint basin
#

the event is not called for survival players

chrome beacon
#

This has also already been answered

quaint basin
#

if i use that, i'll need do like player#setAllowFlight

chrome beacon
#

Yes

quaint basin
#

but this will cause desyncs

chrome beacon
#

Yes

quaint basin
chrome beacon
#

setAllowFlight needs to be set for the packet to be sent

drowsy helm
#

There's no flight packet

wet breach
quaint basin
#

I thought it wasn't necessary

drowsy helm
#

I am wrong

chrome beacon
#

There's a reason why the event requires it

quaint basin
#

I think listening to the player input packet will be easier then

wet breach
#

wonder if that can be used instead of just waiting a few ticks to do stuff now 🤔

weak wasp
#

Has anyone messed with mob AI before?

I'm trying to have a mob follow waypoints from an array. If the block underneath it is the same as the waypoint in the array, it updates it's moveTo goal to the next one. It initializes ok and moves from waypoint 0 towards waypoint 1, but never actually reaches waypoint 1, it stops short like half a block.
Is there some way to have the mobs be more precise, or does the Minecraft AI just say "close enough, we are there"?

drowsy helm
weak wasp
#

No, I am using MobChipLite and simply calling controller.moveTo(location)

weak wasp
thorn isle
#

it stops short like half a block.
this is just the vanilla pathfinder being stupid

#

this is how it always goes

#

if you want it to actually get to the exact waypoint, you need to move it the rest of the way by either tapping into its MovementController or applying a velocity

drowsy helm
#

You can make your own, not super hard

thorn isle
#

that said, the pathfinder api itself should already support waypoints; why are you rolling your own waypoints?

quaint basin
#

player#isOnGround is deprecated. what should I use?

weak wasp
thorn isle
#

paper, don't know if spigot has it yet but it might

#

you can give it a Location to pathfind toward, around obstacles and avoiding fire and all that jazz, and that'll give you a List<Location> of the path leading there

drowsy helm
#

spigot does not

#

only options are goals and brains

thorn isle
#

you can also give it your own List<Location> that it'll try to follow

weak wasp
drowsy helm
#

If you're using mobchip you should be looking into how they implement it

thorn isle
#

there is iirc some way to check whether the pathfinding mob has reached the end of its path, which you can use for your waypoint logic; just tell it to pathfind to the next waypoint

#

that said it does have the same issue of stopping about a block short, since that's just the vanilla move controller being dumb; but the pathfinder will mark the path completed when it does stop

weak wasp
#

Just so long as it keeps going I'm fine with the final location being close enough.

#

Thanks guys

drowsy helm
#

The reason it doesnt go exactly to the point is because pathfinding is inherently innacurate and will never reach an exact point

lilac dagger
#

It makes total sense now

dark moth
#

Can I create a custom effect using NMS ?

lilac dagger
#

With particles?

worldly ingot
#

You can't create a custom potion effect or particle effect

#

Not without replacing another

vagrant stratus
#

server or client limitation lol

worldly ingot
#

Both. Neither the particle nor effect registries are sync'd

vagrant stratus
#

Skill issue from the devs fr fr

#

You'd think that'd be possible by now via data-pack at least tbh

lilac dagger
#

You could make spirals and such with math and existing particles i guess it's the best way

vagrant stratus
#

Yea, that's basically the only way to go about it really

thorn isle
#

kind of sort of can do it with a resource pack and text/item displays

#

they support much of the same fire-and-forget interpolation logic as particles do, and can render an arbitrary sprite from the resourcepack

vagrant stratus
#

Yea, but that's hackier than just doing the math & using existing particles lol

thorn isle
#

depends on what you need to do

#

if there's no matching existing particle, you have to roll your own

vagrant stratus
#

#GiveUsCustomParticlesMojang

young knoll
#

You can make "Custom particles" with text displays and a resource pack

lilac dagger
#

Pretty cool then

vagrant stratus
#

Yea, but being able to use the particle system would be better 😠

worldly ingot
#

Both will take time though because it's not just as easy as enabling registry syncing. For potions they'll probably want to take a similar approach to what they did with enchantments with different "effects" to apply to entities. For particles, maybe a similar system, but either way it would need to be able to control the particle's gravity, speed, etc. over time, plus there are some particles that accept additional data like block and item breaking

#

They have to make them registerable from datapacks but also define all vanilla particles with data

dark moth
#

Ig I'll make something that is somewhat an artifical potion effect

#

thx for the help guys

vagrant stratus
worldly ingot
#

Well yeah lol, wasn't necessary

vagrant stratus
#

Just gotta scrap the entire impl & re-make it KEKW

worldly ingot
#

Block breaking particles were created like 15 years ago

vagrant stratus
#

even I'm smart enough to include the "what if" aspect lmfao (╯°□°)╯︵ ┻━┻

slender elbow
#

yeah why would they consider such thing in the very first iteration of the game

#

lmao

vagrant stratus
#

Implementing particles would suggest potential future particles so why not do it in an easy to expand way lmfao

slender elbow
#

and they did?

#

it's not data-driven

#

like the whole rest of the game back then

#

making it easy to add new particles for future versions does not imply the fact that it has to retrieve it from data packs

#

even today

young knoll
#

Clearly we need to make data driveness itself data driven

#

Then you could make a datapack that allows you to add particles with a datapack

slender elbow
#

by no means is it "fucked" just because the thing is not network-synched, lol

worldly ingot
#

yet

#

I feel confident particles and effects will be data-driven at some point in the future, it's just a lot of work to make something worth data-driving

#

Enchantments were done really well, potions will go the same way

shell sandal
#

hey i need a developer if possible

young knoll
#

?services

undone axleBOT
shell sandal
#

i need a developer for bungeecord

young knoll
#

If you need help, ask the question

young knoll
shell sandal
#

oh sry ty so much

short kestrel
#

can anyone help me for something

chrome beacon
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

short kestrel
#

can we in a talk

thorn isle
#

you do the talk here

#

so we can do the talk with you

short kestrel
#

i can better explain my problem by voice

quaint basin
#

I need to create a plugin to generate resource worlds. How should this be done? Isn't creating a world at runtime costly due to the need for a reset every 24 hours, for example? Besides having to generate the chunks, etc

chrome beacon
#

unless you want the same world each time ofc

quaint basin
#

Or I could sacrifice performance for better gameplay, but I don't know if my machine can handle that lol

thorn isle
#

just rewrite the world generator to work more efficiently ezpz

chrome beacon
#

imo it sounds like you're just doing a bunch of premature optimization

thorn isle
#

perhaps generate the worlds on another machine and copy them over

chrome beacon
#

^ this can also work

chrome beacon
thorn isle
#

unironically not a terrible idea, considering how noise sampling and carvers and such work

#

it's pretty parallel

chrome beacon
#

It's been done before

thorn isle
#

blockpopulators not so much i suppose

chrome beacon
#

Yeah the main issue is structures and things like that

#

but a majority of the terrain can be accelerated on the GPU

quaint basin
vagrant stratus
#

yea, you're more or less screwed with just a single server for what you're wanting lol

onyx fjord
chrome beacon
#

Yeah I'm aware

onyx fjord
#

did making custom enchantments change recently?

thorn isle
#

there's also a goofy but theoretically viable approach of pregenning the world up until the ores, blockpopulators, and structure stages, i.e. doing all the heightmap and carving work ahead of time

#

then copying that, and switching the ore/structure feature seed for each run

#

caves and terrain would be the same for every instance, but ores and other things that matter would be in different places

#

i guesstimate carvers and terrain are probably the most expensive part of generation by virtue of how many blocks they touch, so it could result in nonnegligible savings

sly mesa
#

yo i want a plugin or idk what i need for that, i have a velocity network, i want to make something like if a manhunt game ends on a manhunt server it resets the world world-nether, world the end and restarts or something on 1.20.4. is there any plugin or how can i make this to work?

quaint basin
thorn isle
#

i very much doubt it, it is a very silly thing to do i think

onyx fjord
thorn isle
#

you can get the same results by just changing your paper world config's feature seeds for the ores and structures but keeping the other seeds the same

#

but it won't be any faster than generating a world from scratch

quaint basin
thorn isle
#

doing it through the config? none

#

doing it through a plugin that caches the carver stage? you don't need to do the carver stage each time

#

however having the same terrain, biomes, and caves, but different lootables each "season" could be a cool concept someone might want to do without the performance optimization

#

which is why i mentioned the config approach

quaint basin
#

In this way, the generated world is on the disk, and the only work at runtime would be to define the new locations of the ores/caves etc?

#

and load the world

young knoll
#

I wonder how much time that actually saves

#

I figured most of the time would be after the carving stage

quaint basin
#

what is the replacement to Sound#valueOf?

thorn isle
#

i'd say that carvers, terrain, and lighting probably take up the bulk of it all

young knoll
#

Deprecated.
only for backwards compatibility, use Registry.get(NamespacedKey) instead.

young knoll
#

I guess it depends on how well the game “compiles” noise stuff from datapacks

thorn isle
#

don't carvers evaluate the noise for basically every block in the chunk

#

it's cheap but there are a lot of blocks

young knoll
#

Pretty sure it’s interpolated

#

I think noise is evaluated every 4th block or something

wet breach
thorn isle
#

easiest way to see would be to run spark with chunky or something i suppose

thorn isle
quaint basin
thorn isle
#

so you don't need to regenerate the whole world just for e.g. end city treasure chests, or buried treasure, or what have you

#

the downside is if someone breaks the chest it'll be gone forever

worldly ingot
#

When you're pulling from a registry, you're referencing the key, not the constant name

quaint basin
worldly ingot
#

Sounds like you're depending on Paper

quaint basin
#

yes

worldly ingot
#

get() works fine, they deprecated match() for no good reason imo

#

Does require a key though

thorn isle
#

half of paper patches are deprecating shit for no reason

quaint basin
worldly ingot
#

Registry.SOUNDS.get(NamespacedKey.minecraft("block.slime_block.fall"))

#

that should work fine

quaint basin
#

thx

snow harbor
#

Hi, can someone help me figure out how to apply a non-premium player's skin? It usually shows the skin on premium players' heads even if they change it using the SkinRestored plugin. I'm building a menu plugin and I usually have this snippet:
private static void applyPlayerNameTexture(SkullMeta meta, String playerName, Player viewer) {

    if (viewer != null && playerName.equalsIgnoreCase(viewer.getName())) {
        meta.setOwningPlayer(viewer);
        return;
    }

    Player online = Bukkit.getPlayerExact(playerName);
    if (online != null) {
        meta.setOwningPlayer(online);
        return;
    }
    
    PlayerProfile profile = Bukkit.createPlayerProfile(playerName);
    meta.setOwnerProfile(profile);
}
chrome beacon
#

Hook the SkinRestorer API if you want to use their skins

snow harbor
chrome beacon
#

What did you try

quaint basin
#

'isOnGround()' is deprecated since version 1.16.

#

is this deprecated on spigot?

worldly ingot
#

Yeah. Still useable

#

The deprecation notice is just to inform developers that it's a client-controlled value, so it can't be trusted

#

Cheat clients can just say they're on the ground when they're not. Which is fine if you're not doing anything anti-cheat related :p

quaint basin
thorn isle
#

because that isn't controlled by the client?

quaint basin
#

oh

#

so i should use entity#isOnGround in my case

#

ig

thorn isle
#

i mean it is for the player entity, but that's just how inheritance works

worldly ingot
#

Well Player overrides the implementation of isOnGround() so you're going to use it if you have a player

thorn isle
#

a player is-a entity

#

so if your entity is a player, its onGround is controlled by that player's client

quaint basin
#

so why isn't entity#isOnGround deprecated?

worldly ingot
#

Because it's not a player :p

thorn isle
#

because not all entities are players

quaint basin
#

oh

#

i see

thorn isle
#

an entity that is a player is a player

worldly ingot
#

It's a "All players are entities, not all entities are players" type of thing

thorn isle
#

an entity that is a pig is not a player

quaint basin
#

This deprecated code is annoying because I also need to use setAllowFlight and isOnGround. Or I use entity for one thing and then player for another, which isn't very helpful

#

I know it works for now, but if it says "deprecated," I imagine that means it's marked for removal

chrome beacon
#

Are you even reading what they're telling you 😭

#

Just casting the player to an entity to get rid of the warning isn't going to change anything

chrome beacon
#

It's not marked for removal

quaint basin
#

I thought deprecated meant that

chrome beacon
#

Feels like we always have to tell you the same thing 3 times

thorn isle
#

you're making me angry

quaint basin
#

he said that the deprecated was used to inform developers that it's client-controlled data, but that doesn't imply it can't also be used to mark data as removable lol

lilac dagger
quaint basin
lilac dagger
#

true

thorn isle
#

well, not trusting something and completely ignoring it are different things

#

the vanilla server trusts the client far too much

quaint basin
#

I analyzed his context and he meant to ignore it

thorn isle
#

so we use anticheats to verify that e.g. movement isn't going through blocks

worldly ingot
#

You can use isOnGround() from Player, just maybe don't use it for anything critical like banning them for flying lol. But if you want to use it to check if they're touching the ground so you can send them a message, then who cares if they spoof the "on ground" value

thorn isle
#

in a certain sense it being client-controlled is better for some applications

#

iirc you're trying to do some double-jump fly thing

#

that is one such application

quaint basin
#

In my case, I use isOnGround for double jump on spawn; since I use setAllowFlight for that, it will be able to fly without triggering the anti-cheat on spawn lol

lilac dagger
#

i meant it in the context of isonground or similar things

thorn isle
#

why would you use both setAllowFlight and check if the player is on the ground? if you use allow flight, you just listen to the flight toggle event; the client does all such validation for you

#

you'd use isOnGround in conjunction with the player input event

#

if not on ground and <x ticks since last jump when spacebar is pressed == double jump

quaint basin
thorn isle
#

the jump velocity of the second jump? in whatever event you listen to

#

if you use player toggle flight event, then that

#

if player input event, then that

#

i'm just saying that if you're using the toggle flight event anyway, there's no need to check onGround

quaint basin
thorn isle
#

why would you listen to the packet when there is an event for it

#

but yes, a task will work

quaint basin
#

i read player input packet nvm

#

I read it correctly, but I actually misinterpreted it

quaint basin
#

I use isOnGround to prevent the player from flying away once the double jump happens

thorn isle
#

you do that by cancelling the flight toggle events as they come, so the player can't fly despite having the ability

#

there's no need to toggle it on and off

quaint basin
thorn isle
#

yes, and you don't need to toggle it off

#

just keep it on

#

that said, if you use the input event, you don't need to toggle anything at all, and you have fewer client desyncs; this is the modern approach to this

quaint basin
#

Why do desyncs happen this way?

thorn isle
#

because the client thinks it can fly, but it can't

#

since you are sending it the "you can fly" ability in the abilities packet, but each time the client tries to fly, you tell it to stop flying

quaint basin
thorn isle
#

this means that for the round trip from the client to the server to the client, the clientside player is flying but the serverside player is not

#

so the positions desync

quaint basin
#

I'd like to see a video of this bug bc I'm curious. Anyway, I'll try the input event approach

young knoll
#

You just start flying for a bit

quaint basin
#

https://pastes.dev/Qds62z5qto I have a Redis plugin that serves as a library for all my other plugins that need Redisson. Ideally, would they all share the same pool, or would each plugin have its own RedissonClient?

thorn isle
#

i do this for rabbitmq rather than redis, but it's principally similar; i have a "service" plugin that offers messaging connectivity as a service to other plugins requiring it

#

this means i only need to have the endpoint/credentials configured in one place per bukkit server

quaint basin
#

So you recommend sharing the same RedissonClient for all plugins?

thorn isle
#

it can get a bit nasty with reloading things if you're not careful, but yeah, in the end i think one central service for it will be cleaner

#

how exactly you go about that could vary, e.g. you could have your service provision a separate client for each plugin from the same configuration, rather than actually sharing a single client

quaint basin
wet breach
#

I would just have a plugin that provides the endpoint, this way you only need to check for said plugin and communicate with it leaving a central point to handle your end point configurations/credentials

thorn isle
#

e.g. having each plugin have its own client lets you see who exactly is doing what on the redis server end; if everything somes in through the same client, it can be difficult to identify traffic

#

my main point is that having the endpoint and base config and credentials in one place simplifies management, you should tailor the rest to your needs

quaint basin
#

Isn't it simply a matter of having self-explanatory keys with the plugin name e.g?

quaint basin
thorn isle
#

Then listen to spacebar release rather than press

quaint basin
#

In other words, there would be two cases for a double jump:

1st jump when the player is on the ground and the 2nd jump in less than 200 milliseconds (probably on the 2nd jump the player is not yet on the ground);

OR
Press and hold the spacebar for a few seconds, for example, then do all this while in the air: release, press, release, press, and the double jump happens. The question is how do I differentiate this type of jump from the jump where you double jump before landing?

mortal vortex
#

Can you influence a mob's pathfinding as if it was being attracted / following a player with a food source?

drowsy helm
#

use a pathfinder goal

#

if you look at a mob who does have that trait just copy the same goal

#

should just work

mortal vortex
#

Yeah but like

#

yk how a cow

#

looks at you

#

when u go to feed it wheat

#

is that replicable?

drowsy helm
#

i think thats a goal aswell

mortal vortex
#

why did i send thatin 5 differeent messages bruh 😭

#

eh didnt really wanna touch NMS

drowsy helm
#

or if you want to jank it a bit

#

you can just do the head rotation math yourself

#

only other non library option is paper's pathfinding stuff

mortal vortex
#

thanks

#

top notch guy

drowsy helm
vagrant stratus
#

I mean, you just need the equivalent of the follow code within the API

// Looks at the location
        final double targetY = this.onlyHorizontal ? this.mob.getEyeY() : this.lookAt.getEyeY();
        this.mob.getLookControl().setLookAt(this.lookAt.getX(), targetY, this.lookAt.getZ());

Where lookAt is an entity

vagrant stratus
shadow pumice
#

Whats the latest packetevent? what do i put in pom.xml?

chrome beacon
#

I mean that does not take longer than 10 seconds to search on Google

vagrant stratus
#

That literally could have just been two google searches lmfao

shadow pumice
#

i've found it but its returning error thats why im confused

chrome beacon
chrome beacon
#

What's the error and what does your pom look like

shadow pumice
#

nvm turns out i forgot a fullstop...

somber kelp
#

Does anyone know why my ItemsAdder doesnt show vanilla titles?

vagrant stratus
#

ask in their support discord

somber kelp
#

They dont have support

chrome beacon
#

They do

vagrant stratus
#

You just didn't look hard enough

somber kelp
#

But i need to verify purchase

#

And i am not owner of the jar plugin

vagrant stratus
#

then the owner has to do it

quaint basin
#

Is it possible to increase the range of a bow arrow/increase the shooting speed?

young knoll
#

Yes

#

Use the EntityShootBowEvent and increase the arrows velocity

quaint basin
#

https://pastes.dev/8hrsVcOUcG This is the best solution to allow double jumping if the player presses the spacebar twice quickly while on the ground, or also double jumping if the player presses the spacebar and then, after some time, presses the spacebar twice quickly in the air, thus also double jumping. It's because of this second case that I have the logic for the playermoveevent. Is there a more efficient alternative?

orchid gazelle
#

is there API to get TPS? Couldn't find in docs

#

or do I hook tick start and end and make my own measurements that way?

quaint basin
orchid gazelle
#

should really PR that to spigot

quaint basin
#

If you don't use an API, you'll be performing calculations that other plugins already do, and those other plugins likely have more precise measurements

lilac dagger
#

yeah, sys current time milis isn't a good performance measurement taker

#

actually i'm not entirely sure

#

might be only for benchmarking purposes

quaint basin
young knoll
#

Not on spigot

quaint basin
#

oh t hen this is on paper

#

i tought had on spigot too

lilac dagger
#

and jit, hotspot

quaint basin
orchid gazelle
#

I'd like to use either with millis or, wasn't there some event for TickFinish and TickBegin?

young knoll
#

not on spigot

quaint basin
#

u can't use paper api?

orchid gazelle
#

don't wanna include a full-blown API just to fetch ticks

young knoll
#

Schedulers run at the start of tick iirc

orchid gazelle
young knoll
#

So if you just get the current time in a runnable each tick you could calculate tps

quaint basin
young knoll
#

Or mspt which is more useful anyway

orchid gazelle
#

thanks

#

but, we should really PR that into spigot

quaint basin
#

I might be overcomplicating things, but the fact is that this way you'll have fewer calculations

young knoll
#

MD has already said no

orchid gazelle
#

I am honestly super surprised that this isn't the case already

#

why wouldn't you want that lol

vagrant stratus
#

getTPS just calls

    public double[] computeTPS() {
        final long interval = this.tickRateManager().nanosecondsPerTick();
        return new double[] { getTPS(this.tickTimes1m, interval), getTPS(this.tickTimes5m, interval), getTPS(this.tickTimes15m, interval) };
    }

in the end, so if MinecraftServer#computeTPS isn't a paper method you can just NMS is

orchid gazelle
#

hm

young knoll
vagrant stratus
#

mmm seems to be a paper method lol

young knoll
#

take it up with md ¯_(ツ)_/¯

orchid gazelle
#

it does have a meaning when half the world uses the concept

#

lol

#

well MSPT makes more sense 99% of the time but that's pretty much the same

vagrant stratus
#

seems like ServerTickRateManager is vanilla though.

You'll just have to re-create the method via NMS i guess lol

orchid gazelle
#

schnitzel ok

#

thanks

vagrant stratus
#

You'll probably have to go back & forth with vanilla and paper to see what else they add to make it work but that's a start lol

orchid gazelle
#

I could also get that SystemMillis method running and compare to Paper getTPS and see how close it is

vagrant stratus
#

I'd make a full conversion, but I'm busy with my own thing lol

orchid gazelle
#

fair

#

eh it's ok, just been bored and picked up dev after a few years of not doing anything, but already losing motivation after 2 hours lol

young knoll
#

Last I checked there was just an array in the MinecraftServer class that had the average tps for the last 1 min 5 min and 15 min

#

Might have changed though

orchid gazelle
vagrant stratus
#

I think that's what paper's doing themselves at this point

orchid gazelle
#

but didn't remember if it was nms

vagrant stratus
#

They're kinda doing it weirdly though lol

young knoll
#

MinecraftServer is obviously NMS

orchid gazelle
#

imma call that one a rare Paper W and go on schnitzel

sullen marlin
#

What's TPS?

thorn isle
#

åbo football club

young knoll
#

Ticks per second

#

Duh

#

Gosh MD do you even minecraft bro

vagrant stratus
sullen marlin
#

Only the tick duration line actually explains what it is

thorn isle
#

has any pvp server increased their tickrate to 60tps yet

#

any kind of competitive play at 20 updates per second has always seemed ridiculous to me

sullen marlin
thorn isle
#

isn't that configurable by the server now?

#

i recall there being a tickrate packet now

buoyant viper
#

Badlion did it iirc

buoyant viper
#

using their client + playing on their server had a higher tickrate i wanna say

#

random 1.8 era stuff

thorn isle
#

neat

buoyant viper
#

i could be makin that up i dont remember too well

thorn isle
#

not sure how well it would work without client modifications now, all of the clientside predictions are probably going to be out of whack

#

player movement and attack speed should be doable with attributes, but gravity is going to behave differently, same with projectile drag

#

probably not something the 1.8 pvp sweats who cry about a 0.05% knockback increase want to try adjusting to

young knoll
#

Does anything actually happen on the client when you increase the tick rate

#

I know it slows down when you reduce it but I haven’t noticed anything when increasing it

thorn isle
#

i haven't tried, but i assume it would

wet breach
# thorn isle has any pvp server increased their tickrate to 60tps yet

in the past I have experimented with increasing the tick rate. Not sure how it is now, but I know when I did mess with it and increased it, literally everything increased with that. That is, all the entities and everything moved extremely fast and so did you from the client. Was pretty crazy lol

thorn isle
#

yeah i've seen clips of people getting rid of the tickrate limit altogether and just letting the server run as fast as it can

#

one second you spawn a wither and in a blink all the mobs in a 100 block radius are dead and you're dead in the bottom of a huge crater

wet breach
#

lol

thorn isle
#

for it to work in pvp or regular play you'd have to adjust all other attributes in the other direction proportionally, so like if you double the tickrate, you halve movement speed

#

but not all parts of simulation are adjustable, like gravity or drag

wet breach
#

I recommend people experimenting with it. I died to a zombie and the first time that happened I was like, wait what just happened because yeah it was that quick XD

wet breach
#

I have no idea if it improves anything though mainly my tests usually resulted in me dying before being able to really experiment much of anything

thorn isle
#

in principle it should make the game more responsive; 50ms is quite a long time in a competitive context, most games with competitive gamemodes usually play at 60 updates per second, or even 100

wet breach
#

20-60hz is your typical if its a game that supports a large number of players

#

otherwise for smaller numbers of players its usually around 64 or even as high as 128

#

but in regards to MC, in theory it should make it more responsive but atlas as I said didn't really have a way to test that also didn't want to go find all the places where there was variables relying on the tick rate either at the time

thorn isle
#

to be fair minecraft combat is a joke anyway so i don't know if it'd make much of a difference

wet breach
#

never did like minecraft for combat

thorn isle
#

in sandbox building terms i don't know if it'd make a difference either, i guess in some edge cases like having a high efficiency tool on fast breaking blocks it might be noticeable

vagrant stratus
wet breach
#

lol

vagrant stratus
#

Trying to re-work it to be more like how ow2's ASM library works, as that's nice to use lol

#

Something along the lines of the following and I could do something more optimized, but it fits how things are setup currently cause of the ASM library.

BatchParser parser = new BatchParser(file);
for (Statement stmnt : parser.getStatements()) {
  // instanceof checks & stuff
}
#

side note: this sucks lol

orchid gazelle
orchid gazelle
#

imagine trying to run a 500 mods modpack at 100 tps

#

💀

#

no CPU on earth will do that

wet breach
#

yes it will

#

on modern cpus, clock cycle is 0.2 to 0.3 nanoseconds

#

so 100tps? sure can do it

orchid gazelle
wet breach
#

the reason your cpu taps out and it really isn't tapped out is that its waiting to process stuff and the application is requesting time but since it is full there is no period of time where it stops asking

#

if you increase the number of things to process to clear the queue

#

then it should perform better

thorn isle
#

you can probably get 100tps out of the box on a paper server with 10-15 players on decent hardware, probably many more players if you optimize

wet breach
#

its like putting a slow car on a fast freeway

orchid gazelle
#

10 players yes with awesome hardware

sullen marlin
#

And why one of those

orchid gazelle
#

because this is relevant data that many people would like to be able to fetch without using nms

#

people using nms because spigot is lacking functionality is not a good thing

#

people having to drop support for spigot and only go on with paper because spigot is lacking functionality is also a bad thing

#

(well spigot is not, but the spigot API is, which I'd argue is a part of Spigot)

thorn isle
#

calculating mspt isn't too difficult by using the ServerTickStart and End events, but i think those are paper-only as well

#

so it'd be fine for the api to have a single "magic" number for mspt, say, average of past 1 second, that'd be good enough for most cases

#

if you want to know the mspt of a specific time window, using a different measure, like median or n'th percentile, you can put it together with the events

vagrant stratus
#

@wet breach Found a repo for making compilers & interpreters, don't think it's what i need though lmfaooo

vagrant stratus
#

Yes, but god does it suck

vagrant stratus
#
        if (node.getType() == ICodeNodeTypeImpl.CALL) {
            SymTabEntry routineId = (SymTabEntry) node.getAttribute(ICodeKeyImpl.ID);
            boolean isWrite = routineId == Predefined.writeId || routineId == Predefined.writelnId;
            if (isWrite) {
                for (ICodeNode child : node.getChildren()) {
                    if (child.getType() == ICodeNodeTypeImpl.PARAMETERS) {
                        for (ICodeNode actual : child.getChildren()) {
                            if (actual.getType() == ICodeNodeTypeImpl.WRITE_PARM && !actual.getChildren().isEmpty()) {
                                ICodeNode expr = actual.getChildren().get(0);
                                evalConstString(expr).ifPresent(s -> {
                                    System.out.println(tag(line) + "write-string: " + s);
                                });
                            }
                        }
                    }
                }
            }
        }
wet breach
vagrant stratus
#

Yea, it's for pascal. Not complete, but interesting nonetheless

#

If I bash my head & AI at it long enough I can probably make it work lol

#

I'd need to dig around the code & make sure I don't let this run wide though lmfao

#

for non-ObjFPC scripts it seems fine? Most of what this would be used against is... surprise... ObjFPC lol

vagrant stratus
#

Don't really need Pascal support either for what I'm implementing this in but it's there so I might as well support it fully before adding support for what i actually need lmfao

sullen marlin
young knoll
#

If (Bukkit.getTPS() < 15) {
cancel all events
}

#

Lag solved

ivory sleet
#

what if my max tps is 15 D:

young knoll
#

Who runs a server at 75% speed

#

Deserved

ivory sleet
#

😔

orchid gazelle
orchid gazelle
# sullen marlin What's the use case?

Important Information over the server. There‘s a reason many plugins use it(right now, they either have to hook internals or calculate it with weird events or don‘t support spigot)

orchid gazelle
#

I generally do not know why we are even discussing about it, it should be obvious that it urgently needs to be implemented right now as it costs spigot users since they are using paper because spigot is lacking functionality, this being an example

thorn isle
umbral ridge
#

in votifier what does that even mean?

#

someone voted? and what happened... what exactly connection reset?

lilac dagger
#

I saw this in the minecraft client when you force stop the server

#

Not sure if it's the same thing

thorn isle
#

the other party's end of the connection blew up or it died somewhere in the middle

wet breach
umbral ridge
#

XD

umbral ridge
wet breach
#

sometimes or all the time?

umbral ridge
#

sometimes

wet breach
#

then its most likely a rate limit

umbral ridge
#

the ip comes from a datacenter

thorn isle
#

it's an inbound connection

umbral ridge
#

yea

thorn isle
#

vote sites are run by profoundly incompetent people

umbral ridge
#

ill get rid of these probably once i set up my firework properly

wet breach
#

oh inbound, then I suspect cipher disagreement then

umbral ridge
#

right now im setting things up

thorn isle
#

i frequently have like 10% of my incoming votes not register because of this

wet breach
#

lag/loads can cause a TCP RST to be thrown as well

#

they can be pretty random sometimes lol

#

also firewalls are notorious for causing them too

#

just like out of the blue the firewall is like we should just kill this for no reason

thorn isle
#

yeah they're probably running their entire vote site on a 1vcpu webserver

#

that's how it feels at least

wet breach
#

wouldn't be surprising

umbral ridge
#

its not a 1vcpu webserver

#

it's a dedicated server with 4 cores and 8gb of ram

wet breach
#

they meant the vote site

#

not your box

umbral ridge
#

ohh

#

yeah the voting site is mine too

wet breach
#

the vote site is yours?

umbral ridge
#

yeah

#

pretty cool stuff

#

XD

#

its hidden on a subdomain in certain folder

#

but yeah bots can find it

wet breach
#

and what exactly is the purpose of voting on your own vote site for your own server?

umbral ridge
#

XD

#

setting up a voting system

wet breach
#

then if it happens only from your vote site or with it, then I will have to say its most likely cipher disagreement

lilac dagger
#

Wait, what's a cipher disagreement in this case?

#

I worked with sockets and they were pretty straightforward

slender elbow
#

tls presumably

lilac dagger
#

But still it should be on first connection and after that both have their private key for their communication

slender elbow
#

if they agree on a cipher from the cipher suite

#

what if they don't

wet breach
# lilac dagger Wait, what's a cipher disagreement in this case?

there is a few different ways a cipher disagreement can happen. Anyways the client connects and tells the destination it wants to use a particular cipher, server responds and says no you can only pick these ones. If the client has one on the list but less secure it may ask to use that and the server may say no. If for some reason both can't negotiate a cipher to use a TCP RST is sent.

umbral ridge
#

it's random bots sending requests and it mismatches the nuvotifier v1 parsing

#

so it throws an exception

#

but connection reset is something new

#

it means the connection was dropped at the end from what i read

wet breach
#

well you will have to look through the code in what is being handled and why that exception gets thrown. Aside from that there is actually a number of reasons to get a TCP RST

umbral ridge
#

XD

wet breach
#

too many out of order packets can do it

lilac dagger
umbral ridge
#

novotifier api doesnt really provide any exception handling

#

it happens internally

wet breach
#

if the application can determine more specifically, I agree it should use a more specific exception

lilac dagger
#

Is the code open source?

#

You could modify it for your needs

umbral ridge
#

yeah

#

it is

lilac dagger
#

Yeah just make your own fork of it

jagged thicket
#

yo anyone

#

gimme sm suggestions on what should i code

#

can be anything, just make sure its medium difficulty to execute, not too easy, not too hard

slender elbow
#

a program that solves the collatz conjecture

vagrant stratus
#

simulate the entire universe

jagged thicket
#

claude, simulate the entire universe (make sure u dont go over the free credit limit)

vagrant stratus
#

actually, I'm curious. I'll see what codex comes up with lmfao

#


Implemented the simulation core with professional numerical/physics practices: randomized body initialization, softened Newtonian gravity, Velocity Verlet integration, collision detection, and inelastic body merging with momentum-based velocity recomputation.

Added a robust CLI entrypoint with argument parsing, validation/error handling, and periodic simulation telemetry output (bodies, collisions, KE/PE, momentum magnitude).

This is really the only interesting bit of it lol

quick kite
#

how to do that custom screens?

young knoll
#

Dialog

quick kite
#

thank you 🙂

quaint basin
onyx fjord
#

Like no server uses them

thorn isle
#

they're hard to make look good (i'd say the above example does not look very good) and the api/client capability on them has been unstable since it was introduced

#

plus it's fairly recent and many servers try to cater to at least a couple major versions with viaversion

slender elbow
#

i'm pretty sure VB is able to translate dialogs into chest UIs

#

but, in any case, dialogs are limited by design and are not a replacement for inventory UIs

echo basalt
#

I've used them for a thing or two

#

they suck for that kind of UI but they're ok for inputs

slender elbow
#

yeah

#

they feel more so like a simple UI replacement for commands instead

#

otherwise inventory UIs fulfill much greater roles

echo basalt
#

yup

#

I think they're a replacement for sign / anvil uis

thorn isle
#

my main problem with them is that they "take you out" of the game; it looks much more like the pause/settings menu than something that's part of the game world, like a villager trading gui for example

#

on the other hand my main problem with chest guis is that it's next to impossible to render dynamic text on them, and rendering static text involves resourcepack nonsense; hovering over a bunch of icons for hover tooltips for all your text needs is not very good ux

#

i do wish they would expand dialogs a bit in the future, but i doubt it'll happen

echo basalt
#

dynamic text is easy enough when you get the hang of it

#

the guys at work did bad apple on a chest ui

thorn isle
#

depends on how dynamic you need it to be

#

e.g. i've wanted to do a chest gui with a text box displaying realtime output from a llm

echo basalt
thorn isle
#

how're you doing the ascents? do you have a separate font with a different ascent for each line?

echo basalt
#

the boys at work wrote a script to generate like 50 fonts

#

I did these by hand tho

#

and then it's just layering components by knowing the width of each pixel and all

#

yada yada

thorn isle
#

this would probably work for what i need, i'll have to think about it some

echo basalt
#

yep

#

client got overwhelmed

chrome beacon
#

ofc you played bad apple on it 💀

echo basalt
#

gotta downscale the resolution to like 55x36 and play the shrek movie

thorn isle
#

seems a tad jittery

lilac dagger
#

How's this made?

#

Resource pack?

smoky anchor
#

yes, font magic

lilac dagger
#

I see

#

Pretty cool

#

Arrays are king, i had an algorithm using a tree map and i was running out of memory sorting 64k blocks

#

With a int array i mamaged to store it all

#

With the default ram amount, i don't have the xms parameter in my cmd

young knoll
#

0/10

echo basalt
#

not my video

#

but yeah I'd hop on the lang file and nuke inventory.title

young knoll
#

You can probably make Dialog's just as fancy with font magic

echo basalt
#

they were a bit limited

quaint basin
#

I need to create an AFK region plugin. Is there a WorldGuard API that could help me with this?

slender elbow
#

worldguard has an api, yes

vagrant stratus
#

not good, but it has one

ivory sleet
#

Might be somewhat unoptimized for an afk region plugin since its likely gonna be query heavy

quaint basin
#

hmm alr thanks

#

i'll use triggerzones

#

And out of curiosity, why isn't Worldguard suitable for this?

ivory sleet
#

imo its perfectly suitable (the api)

#

but depending on what your needs are, worldguard itself might be less suitable for you

chrome beacon
#

but if you're already using it on your server you might as well use their api

quaint basin
#

I already use Worldguard to protect the worlds, etc

#

oh

quaint basin
#

From what I've seen, there aren't any events like ZoneEnterEvent or anything similar

thorn isle
#

worldguard definitely has an api to check if a player is in a region

lilac dagger
#

yeah

#

even if there's not it's easy to make one

vagrant stratus
# quaint basin This seems to indicate that there's no API to determine if a player is in an are...

for my plugin events aren't needed lol

TriggerZones plugin = (TriggerZones) pluginManager.getPlugin("TriggerZones");
RegionManager regionManager = plugin.getRegionManager();
Location minCorner = new Location(getServer().getWorld("world"), 100, 50, 100);
Location maxCorner = new Location(getServer().getWorld("world"), 110, 60, 110);
TriggerZone trigger = new TriggerZone("example_zone", minCorner, maxCorner);
trigger.addAction(TriggerZone.TriggerEvent.ENTER, new SendMessageAction("You have entered a zone");
regionManager.addRegion(trigger);
#

WG in general can work, but is overkill as previously stated

quaint basin
vagrant stratus
#

For the editor branch, that'd be an oopsie on my part since I forgot to include that lmfao
One moment lol

quaint basin
#

kk

vagrant stratus
quaint basin
#

thx

quaint basin
vagrant stratus
#

Depends, really. Theirs is certainly more complete having flags & the like but that's stuff I plan on implementing as well

quaint basin
#
TriggerZone zone = TriggerZones.getPlugin(TriggerZones.class).getEditor().getZone("afk");

        zone.addAction(TriggerZone.TriggerEvent.ENTER, action -> {

            Player player = action.getPlayer();

            return false;
        });
#

I don't understand the purpose of the boolean in addAction

vagrant stratus
#

It's for a conditions check within the plugin itself

#
       if (zone.allConditionsMet(TriggerEvent.ENTER, ctx)) {
                currentZones.add(zone);
            }
quaint basin
#

And what is the purpose of this?

vagrant stratus
#

Determines if the zone the player is in should be taken into account or not

#
        for (TriggerZone zone : currentZones) {
            if (!previousZones.contains(zone)) {
                TriggerContext ctx = new TriggerContext(zone, TriggerZone.TriggerEvent.ENTER, player, from, to);
                zone.onEnter(ctx);
            }
        }
        for (TriggerZone zone : previousZones) {
            if (currentZones.contains(zone)) {
                continue;
            }
            TriggerContext ctx = new TriggerContext(zone, TriggerZone.TriggerEvent.LEAVE, player, from, to);
            if (zone.allConditionsMet(TriggerZone.TriggerEvent.LEAVE, ctx)) {
                zone.onExit(ctx);
            }
        }
#

Tad messy but shhh it was quicky pulled out of a proprietary game engine lol

quaint basin
#

From what I understand, if I do zone#addAction and return false, then it's not possible for the enter action to be called on the same tick as the exit action?

#

But this doesn't make much sense since the entry would never be called on the same tick as the exit; therefore I'm lost xd

vagrant stratus
#

one moment lmfaooo

#

Splitting it between Action & Requirement. Although the general code should be correct. I think
Actions can't be ran in a zone the player isn't "in". "in" in this case is a TriggerZone where all conditions are met.

#
Requirements are all met
  - Player is within the zone AND triggering it
      - Run enter/exit as necessary
Requirements aren't met
  - Player is within the zone but NOT triggering it
#

Used for xp triggers, LP rank checks, etc

quaint basin
#

I'm lost 😭

thorn isle
#

what are you even trying to do

quaint basin
#
zone.addAction(TriggerZone.TriggerEvent.ENTER, action -> {

                Player player = action.getPlayer();
                player.sendMessage("enter afk zone");

                return false;
            });

is this called From what I understand, in this code, for example: the block's logic will be executed if the player enters the region for the first time, but since it's returning false, the next time the player enters that same region, this logic will not be executed because I returned false previously

vagrant stratus
#

Hm

#

I don't think that'd be the case, as it checks every time they enter/exit

ivory sleet
vagrant stratus
#

if I didn't fuck up the checks anyways

quaint basin
quaint basin
# thorn isle what are you even trying to do

I'm using their API to track when a player enters/leaves a region in order to create an AFK plugin where the player receives a reward every 10 seconds in the region, but I don't understand their API

vagrant stratus
thorn isle
#

i'd just check all players every 10 seconds rather than bothering with enter/exit events specifically

quaint basin
quaint basin
ivory sleet
#

yea but it builds up cuz PME is invoked insanely frequently

thorn isle
#

sure, and they have to wait 10 seconds for the next reward

vagrant stratus
#

Praise be

        if (to.getBlockX() == from.getBlockX() && to.getBlockY() == from.getBlockY() && to.getBlockZ() == from.getBlockZ()) {
            return;
        }
quaint basin
thorn isle
#

no, at most 10 seconds

quaint basin
#

And it's not 10 seconds; it's 1 minute. I gave a low example value, but there are more. So it's something relevant here

thorn isle
#

i'd probably still stick with a timer that checks all players every few seconds and increases their counter

#

doing that vs doing region checks every time any player moves is still cheaper

quaint basin
# thorn isle no, at most 10 seconds

They enter 1 second after the scheduler is executed; therefore, they won't receive the next reward (from what I understood from what you said, since this way they would receive it in less than 10 seconds) and then they would only receive the next reward on the next scheduled event, which is 19 seconds later

thorn isle
#

not at all what i said

ivory sleet
thorn isle
#

perhaps

#

octrees are fast as well

#

i usually do this with chunk section sized buckets

ivory sleet
#

yea

vagrant stratus
#

?paste

undone axleBOT
vagrant stratus
thorn isle
#

add an y axis to the buckets and it'll be fine

vagrant stratus
#

Yea, it's not perfect. It needs to be per-world too lol

ivory sleet
vagrant stratus
#

oh?

ivory sleet
#

its just quite limiting ig, since u only allow for cuboids

thorn isle
#

i'd probably replace the nested hashset with a ReferenceArraySet

#

a bit slower to update but is much smaller in memory and much faster to iterate than even linked hash sets

ivory sleet
#

is BoundingBox bukkits boundingbox?

vagrant stratus
#

I'm accepting PRs though

#

okay yea, fucked up the logic though. That'll be v0.7 so get your PRs in now otherwise that'll have to wait lmfao

ivory sleet
#

:,)

vagrant stratus
#

KEKW

vagrant stratus
quaint basin
thorn isle
#

worldguard i think uses an octree, but their region query logic spawns garbage objects so i don't quite like their approach

vagrant stratus
#

The code itself is flawed. v0.7 will fix that

quaint basin
#

But you used the same supplier for the actions

vagrant stratus
#

v0.7 also deals with that

vagrant stratus
thorn isle
#

depends a bit, i think yours will work better for having many sparse regions, but octree will outperform buckets when there are many closeby regions that overlap the same bucket

vagrant stratus
#

oh wait. I do have isInSameWorld. Question is if I'm actually use it lol

#

yea i do

#

okay, just doesn't do the y thing KEKW

young knoll
#

Oh hey it’s still using my region code

#

Kek

vagrant stratus
#

Yea kekw

#

good impl is good impl lol

young knoll
#

A tree would probably be better but this was much faster to make :p

vagrant stratus
#

Well PR it for v0.8 lol

young knoll
#

Might be good practice

#

I’ll consider it

vagrant stratus
#

😎

young knoll
#

I wonder if an octree is super worth it compared to a quad tree

#

Worlds aren’t that tall and often regions cover the entire vertical height anyway

quaint basin
vagrant stratus
young knoll
#

Worlds still aren’t super tall

#

Compared to the other axis :p

vagrant stratus
#

lol

They still can be any height, width, or length though lmfao

vagrant stratus
vagrant stratus
young knoll
#

Does the editor look super fancy

thorn isle
vagrant stratus
#

Nah, it's just a simple command & right/left click for now

#

Just enough to do basic editing

thorn isle
#

if all your regions encompass the entire world height, you won't necessarily end up with any vertical partitions in your tree

#

not with a standard octree, but something like binary space partitioning

vagrant stratus
#

which probably won't be the case, unless a user creates them that way lol

#

Each region takes a normalized min x, y, z and normalized max x, y, z which is based off of the corner block coords.
The check verifies the player is within that specific region

#

It is likely not often someone would go out of their way to encompass the entire world height

#

built-in support for zones which cover the entire world height can be added, but certainly wouldn't be default and would likely be a per-zone thing

quaint basin
#

https://pastes.dev/VvxGrqoaHe Whenever I restart the plugin with /plugman reload, +1 message is printed when entering a region; how on earth is that possible lol? The message is also printed if I leave the plugin disabled

vagrant stratus
#

Yea, no guarantee any plugin works properly when reloading w/ plugman

#

I know that the plugin works as intended on server restart though

thorn isle
#

are you unregistering your trigger or whatever when your plugin unloads

#

since the region system doesn't accept a plugin along with your trigger, it can't unregister it for you

vagrant stratus
#

Actually, I could probably have the plugin unregister them

thorn isle
#

every time your plugin reloads, it registers new actions into the region system, and it will call them all

#

this is why bukkit always requires you to pass a plugin along with any registration

vagrant stratus
#

in my defense, this was originally made for a proprietary game engine & was programmed initially as such lol

thorn isle
#

i mean i'm mostly telling g lima to unregister his things in onDisable if he intends to reload his plugin

#

supposing you have a way to unregister things at all

vagrant stratus
#

I'm testing 0.7 rn so I can quickly double check and verify lol

thorn isle
#

making plugins reloadable is pretty simple once you know the gotcha's

#

personally i still make most of my plugins reloadable wherever possible

#

sometimes complex cross-dependencies make it difficult

lilac dagger
#

all my minigames are reloadable

#

the /arc reload command for example just does plugin.onDisable plugin.onEnable

quaint basin
vagrant stratus
quaint basin
#

Ah, I understand what's happening. I reload my plugin, which uses his plugin so this happens. I need to remove the action when it shuts down, but I don't know if that's possible xd

vagrant stratus
#

Working on it!

quaint basin
#
 @Override
    public void onDisable() {

        TriggerZone zone = TriggerZones.getPlugin(TriggerZones.class).getEditor().getZone("afk");

        if (zone != null) {

            for (Pair<TriggerZone.TriggerEvent, TriggerComponent> pair : actions) {
                zone.removeAction(pair.key(), pair.value());
            }

        }

    }
#

What you can do is integrate this into your plugin but its ur choice

vagrant stratus
#

I really gotta automate github releases istg

drowsy helm
vagrant stratus
#

in my defense, I just haven't bothered @drowsy helm LMFAO

quaint basin
vagrant stratus
#
TriggerZones plugin = (TriggerZones) pluginManager.getPlugin("TriggerZones");
TriggerZoneManager manager = plugin.getTriggerZoneManager();
// add, remove, get, save, load

Requirements & Actions are now completely split

TriggerZone#addRequirement(TriggerEvent, TriggerRequirement)
TriggerZone#addAction(TriggerEvent, TriggerAction)
// same with clear & remove

TriggerZone#allConditionsMet -> TriggerZone#allRequirementsMet

Actions -> no boolean
Requirement -> boolean. Used for validating if a player should trigger zones that they're in

Fucked logic should be fixed
#

Editor's more or less the same.
Only removed some methods which got added to TriggerZoneManager & i cleaned up the list subcommand

Currently in the middle of splitting the editor off into a separate plugin, instead of just a fork lol

quaint basin
#

i see

thorn isle
#

Triggerzones however does not take your plugin as a parameter and so cannot automatically associate your listener with your plugin to unregister it

vagrant stratus
#

^ bukkit shenanigans & not me making an oopsie for once lol

#

tbf TZ doesn't do anything w/ listeners & has its own system in place for that kinda stuff, which a plugin should handle itself anyways lol

young knoll
#

I always just register listeners in onEnable and it works fine

#

Since reloading will call it again

orchid brook
vagrant stratus
sly topaz
#

can just contribute it

vagrant stratus
sly topaz
#

no license on the editor 👀

vagrant stratus
#

fuck

#

It's GPLv3 like the library, but apparently I forgor the license lmfao

vagrant stratus
#

You'll be waiting a bit though, as I'm working on v0.3.0 of the editor lol

vagrant stratus
#

You can now toggle the ability to see the zone 😎

young knoll
#

Needs more display entities

vagrant stratus
#

Nah. Particles are good enough lol

young knoll
#

3/10

vagrant stratus
#

no u

#

support for multiple zones + selection 😎

I gotta clean this up though lmfao

young knoll
#

That would be so good with colored display entities!!!!11

vagrant stratus
#

you better PR it when i push the editor update or istg

young knoll
#

The annoying part is dealing with unloading

#

Particles are much simpler in that regard

vagrant stratus
#

Sounds like it needs PR'd

vagrant stratus
#

@young knoll get to work KEKW
Just pushed updates for the library & editor

mortal hare
#

i've been stuck with this simple problem for a while.

.get(async (context) => {
    return context.json(success(context, "update"));
  });

how do you ensure the safety of such situations that context variables will be the same across call chain without exploding your code with combinatorial variants of factory methods.

#

is it even possible

#

like i can just make a new function successJson but imagine if i had failure, error, etc.. it becomes NxM combinatorial problem

echo basalt
#

generic typing?

mystic sky
umbral ridge
#

bruh

#

ill have to add a passthrough only for the web server for my local db server

wet breach
#

o.O

umbral ridge
#

I fixed it

wet breach
#

well that is good

pine forge
thorn isle
#

what command are you trying to execute? not all commands, especially if they do things like async db queries for e.g. economy, finish sending their feedback before the command "completes"

#

note also that spoofing your own command sender is not going to work with vanilla commands, since those "unwrap" it to get the underlying nms command sender

pine forge
#

i know i tried many commands, vanilla and plugin commands they all dont capture output, in the console it looks like it should capture it based on the timing

#

output is empty

#

also, when just implementing CommandSender it crashes with some IllegalArgument error

#

ive been using log handlers before that just listen to the console during that time which worked but other messages can leak in and its not very clean.
Theres no way you cant just use your own commandsender and it doesnt send you the messages

thorn isle
#

eyeballing it, it should work, and i've done something like this prior, though i used a CommandBlockSender rather than the console sender

pine forge
#

okay, i can try that one

#

theres also RemoteConsole sender

thorn isle
#

try that perhaps and if it still doesn't work, plug it into a debugger and see where the message is getting lost

#

that's for RPC, which is kind of exactly this

pine forge
#

so just return null for the getBlock method?

thorn isle
#

i don't remember

pine forge
thorn isle
#

basically look at nms and see what it calls on the sender you pass to dispatchCommand, and implement those methods appropriately

thorn isle
pine forge
#

ah you can also do hot reloading righ

#

i tried that before you can even do it remote

thorn isle
#

sorta but the support depends on your jdk

pine forge
#

forgot how though

thorn isle
#

it's pretty simple

pine forge
#

my server is remote

thorn isle
#

you just pass a flag to the minecraft server telling it to bind to some debugger port

pine forge
#

ah

thorn isle
#

remote makes it a bit more complicated since you don't want the port to be open to the internet

#

if you have ssh access to the machine, you can "tunnel" that specific port over ssh

thorn isle
pine forge
thorn isle
#

i'd recommend running a local test server for it however, since remote debugging isn't anywhere near as good as local

#

and at the end of the day, the built-in RPC might probably be better as it will work with vanilla commands also

#

just remember not to expose the rpc port to the internet

vagrant stratus
#

or do, and then likely quickly regret it lol

thorn isle
#

basically exactly what you're doing, but over a network

#

login, run command, get command output

lilac dagger
#

I saw something like this in server.prop

#

Never tried it tho

#

There's password, good

thorn isle
#

there's also some new "server management protocol"

lilac dagger
#

Hm?

pine forge
#

can i see in the console whether or not my debug is running?

lilac dagger
#

If there's messages sent to the console pretty sure

thorn isle
#

it looks a lot like the remote console but for shit like whitelisting and changing gamerules or something

#

seems a bit redundant but whatever

thorn isle
#

set a breakpoint in the tick loop or something and see if the server hangs

#

your ide console should tell you whether it connected successfully or not

pine forge
#

well it doesnt connect

#

i have a ssh tunnel set up

thorn isle
#

are you doing remote or local? i recommend local regardless

#

remote is kind of ass

#

just grab a paper jar, launch it with the agentlib arg, toss your plugin in it, and connect to the local port

pine forge
#

okay so blockcommandsender does not work, atleast not with null block

#

errors