#help-development
1 messages · Page 1332 of 1
consider for example weights 0.9 and 1.0
They just made it
you would assume 1.0 would be more likely than 0.9, right?
yes but for what purpose
this is for my friends
and they want for what lol
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
0.9 is 0,473684211
1 is 0,526315789
i think it's correct no?
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
someone knows their math. What you spoke about is similar to how some heuristics works in regards to determining some things especially in games
[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
@umbral ridge
thank you, can I use it in my plugin?
Ah, I understand now; it's because it's called when I press and when I release the key
.
for anyone wanting to test it out 😄
this one works properly
as @thorn isle helped me 😄
This is also what i was talking about Fr33styler lol
pretty cool
once for pressing the key and another for releasing the key, same as with wasd
this still doesn't look right
hmm
That’s similar to what I do
Yeee don't remember off the use case off the top of my head, I think it was for item config stuff though
Yea, inventory population lol
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
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();
}
}`’’
And how does the Minecraft server distinguish if the player wants to fly or is simply jumping? Does it check the timing?
oh, higher entry
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
Correction: It supported both vanilla LootTables & custom ones
The client decides that
It supported OpticFusion and LootTables
now you no longer need the nested arraylist
since you change weightCumulative in every iteration, every key is guaranteed to be unique
i assume all weights are different?
unless an entry has a weight of zero
Yeah you gotta say no to 0 weights
weights need not be different, but cumulative weights are
Materials, LootTables, misc things
It's genericized kekw
you're a math wizard sir, teach me your ways
just learn math
i am trying actually 😄
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
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...
isn't professor dave a fraud
i remember seeing some controversy recently but i didn't pay it much attention
fraud in what way?
something something not actually a professor
If the videos are good that's the important thing
myeah fair
There's much more to worry about than a title lmfao
i don't have only him in my playlist so he's not my only source
I wouldn't say it would be fraud to call yourself a professor if you actually teach people. Just because you are not hired by a "school" doesn't mean you couldn't technically be one
don't need to be a professor to know math anyway
^
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 🙂
We can dub you as the professor of math
let's not maybe
i'll try finding where i saw that controversy later and seeing what ti was about
LET'S
I do want to re-write this in C++ actually. That'll be fun lmfao
he says this on his profile:
I say this qualifies them to be a professor
makes sense why they know math too lol
They teach a few different things actually
Physics, Latin, Mathematics, Pharmacology, Italian, Chemistry, Economics, and a few other things
and what packet they send to server?
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
what event
PlayerToggleFlightEvent event is just called if the player is on creative mode
and i need to listen if the player is on survival too
You can setAllowedFlight in survival too
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
jump event + timer + onGround check should do it i think
We don't really know what version they're on but yes that would also work
I'm on latest
That's good, then you gave give the input event a try
I'd like to know if the Minecraft server implementation determines if the client wants to fly
I wouldn't want to use timers for this
It doesn't
I already told you this
because a packet can take a while to arrive, etc
but the client does not sent any packet
It does
what is the packet
Why do you want to listen to the packet
If the client sends a specific packet telling the server that it wants to fly, then it's best to listen for that packet and I don't need to listen for the PlayerInputPacket
it is triggered by the packet
what event?
because you want to recreate the event
the event is not called for survival players
This has also already been answered
if i use that, i'll need do like player#setAllowFlight
Yes
but this will cause desyncs
Yes
i just want listen this to survival players
setAllowFlight needs to be set for the packet to be sent
There's no flight packet
I thought it wasn't necessary
I am wrong
There's a reason why the event requires it
I think listening to the player input packet will be easier then
oh I see there is a new packet clients send from looking at the wiki, the loaded packet. This is actually kind of nice
wonder if that can be used instead of just waiting a few ticks to do stuff now 🤔
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"?
are you using a custom pathfinder goal?
No, I am using MobChipLite and simply calling controller.moveTo(location)
Would I have to implement a Pathfinder goal? I thought that was just if you wanted to avoid obstacles and stuff
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
You can make your own, not super hard
that said, the pathfinder api itself should already support waypoints; why are you rolling your own waypoints?
player#isOnGround is deprecated. what should I use?
Didn't realize there was a Pathfinder API, I'll look into it. Is it for Spigot, MobChipLite, or Paper?
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
you can also give it your own List<Location> that it'll try to follow
No Spigot doesn't I'm pretty sure, that's why I depend on MobChipLite...
If you're using mobchip you should be looking into how they implement it
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
That would work
Just so long as it keeps going I'm fine with the final location being close enough.
Thanks guys
Pathfinder goals have a continue method (i forget the exact name) Which is just a boolean which determines whether to finish the goal execution or continue ticking.
You'll find in the implementation theres a threshold which you can modify if you just override it yourself
The reason it doesnt go exactly to the point is because pathfinding is inherently innacurate and will never reach an exact point
I finally understand your way approach, my approach gave a percentage but it wasn't filling the whole range from 0 to 1 therefore floor entry was working some times and sometimes not at all, while your approach gave each element a part of the 1 filling the range even with one element
It makes total sense now
Can I create a custom effect using NMS ?
With particles?
You can't create a custom potion effect or particle effect
Not without replacing another
server or client limitation lol
Both. Neither the particle nor effect registries are sync'd
Skill issue from the devs fr fr
You'd think that'd be possible by now via data-pack at least tbh
You could make spirals and such with math and existing particles i guess it's the best way
Yea, that's basically the only way to go about it really
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
Yea, but that's hackier than just doing the math & using existing particles lol
depends on what you need to do
if there's no matching existing particle, you have to roll your own
#GiveUsCustomParticlesMojang
You can make "Custom particles" with text displays and a resource pack
Pretty cool then
Yea, but being able to use the particle system would be better 😠
I would imagine it's on their todo list
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
well that sucks
Ig I'll make something that is somewhat an artifical potion effect
thx for the help guys
TLDR; It's fucked because this wasn't taken into account during first implementation of these things by making a proper data-driven particle system
Well yeah lol, wasn't necessary
Just gotta scrap the entire impl & re-make it KEKW
Block breaking particles were created like 15 years ago
even I'm smart enough to include the "what if" aspect lmfao (╯°□°)╯︵ ┻━┻
yeah why would they consider such thing in the very first iteration of the game
lmao
Implementing particles would suggest potential future particles so why not do it in an easy to expand way lmfao
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
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
by no means is it "fucked" just because the thing is not network-synched, lol
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
hey i need a developer if possible
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
i need a developer for bungeecord
If you need help, ask the question
If you want to hire someone, go here
oh sry ty so much
can anyone help me for something
?ask
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!
can we in a talk
i can better explain my problem by voice
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
You're not really going to get away from generating the world
unless you want the same world each time ofc
I was thinking of having like 5 worlds and switching between them. I don't know if that would be repetitive
Or I could sacrifice performance for better gameplay, but I don't know if my machine can handle that lol
just rewrite the world generator to work more efficiently ezpz
imo it sounds like you're just doing a bunch of premature optimization
perhaps generate the worlds on another machine and copy them over
^ this can also work
GPU accelerated world gen 🧠
unironically not a terrible idea, considering how noise sampling and carvers and such work
it's pretty parallel
It's been done before
blockpopulators not so much i suppose
Yeah the main issue is structures and things like that
but a majority of the terrain can be accelerated on the GPU
I'm going to buy a $10 machine just to generate the world xd
yea, you're more or less screwed with just a single server for what you're wanting lol
a thing already
I don't run single server
did making custom enchantments change recently?
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
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?
Is there a plugin that does this?
i very much doubt it, it is a very silly thing to do i think
look up manhunt plugins maybe there is one
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
So what's the advantage of that?
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
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
I wonder how much time that actually saves
I figured most of the time would be after the carving stage
what is the replacement to Sound#valueOf?
i'm not too sure, the carvers and terrain touch a very large number of blocks while ores and trees and such touch relatively few
i'd say that carvers, terrain, and lighting probably take up the bulk of it all
Deprecated.
only for backwards compatibility, use Registry.get(NamespacedKey) instead.
Yeah but population includes checks and conditions and all that, carving and base terrain are just noise formulas
I guess it depends on how well the game “compiles” noise stuff from datapacks
don't carvers evaluate the noise for basically every block in the chunk
it's cheap but there are a lot of blocks
Pretty sure it’s interpolated
I think noise is evaluated every 4th block or something
there was a plugin long ago that modified loot tables like this
easiest way to see would be to run spark with chunky or something i suppose
paper does this sort of out of the box by re-rolling the loot table for each new player with a new seed
like this ? Registry.SOUNDS.get(Objects.requireNonNull(NamespacedKey.fromString("BLOCK_SLIME_BLOCK_FALL")));
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
There's a convenience method, Registry.SOUNDS.match("block.slime_block.fall")
When you're pulling from a registry, you're referencing the key, not the constant name
'match(java.lang.String)' is deprecated and marked for removal
Sounds like you're depending on Paper
yes
get() works fine, they deprecated match() for no good reason imo
Does require a key though
half of paper patches are deprecating shit for no reason
idk how should I create the namespacedkey
Registry.SOUNDS.get(NamespacedKey.minecraft("block.slime_block.fall"))
that should work fine
thx
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);
}
Hook the SkinRestorer API if you want to use their skins
I tried it but it didn't work. I'm new to this, I don't know if you could give me an example if you have one.
What did you try
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
And why isn't entity#isOnGround deprecated?
because that isn't controlled by the client?
i mean it is for the player entity, but that's just how inheritance works
Well Player overrides the implementation of isOnGround() so you're going to use it if you have a player
a player is-a entity
so if your entity is a player, its onGround is controlled by that player's client
so why isn't entity#isOnGround deprecated?
Because it's not a player :p
because not all entities are players
an entity that is a player is a player
It's a "All players are entities, not all entities are players" type of thing
an entity that is a pig is not a player
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
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
^^
It's not marked for removal
I thought deprecated meant that
.
Feels like we always have to tell you the same thing 3 times
you're making me angry
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
you really can't trust the client with anything
If that were the case, the client wouldn't be able to walk around the map
true
well, not trusting something and completely ignoring it are different things
the vanilla server trusts the client far too much
I analyzed his context and he meant to ignore it
so we use anticheats to verify that e.g. movement isn't going through blocks
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
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
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
i meant it in the context of isonground or similar things
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
In this case, in which event is the velocity set?
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
I don't know how to set the velocity of the player listening to a packet. the best way is create a task for that?
why would you listen to the packet when there is an event for it
but yes, a task will work
i read player input packet nvm
I read it correctly, but I actually misinterpreted it
I don't understand why. This is my current implementation https://pastes.dev/CPoQlXsJo2
I use isOnGround to prevent the player from flying away once the double jump happens
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
The need to toggle on is so that the PlayerToggleFlightEvent is called even when you are in survival mode
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
Why do desyncs happen this way?
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
I think it's because that way allowFlight is true, and when switching worlds, setCancelled won't be called, allowing the player to fly in survival mode
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
I'd like to see a video of this bug bc I'm curious. Anyway, I'll try the input event approach
You just start flying for a bit
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?
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
So you recommend sharing the same RedissonClient for all plugins?
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
I don't think that makes sense; the advantage of having a separate RedissonClient for each plugin is precisely to have its own configuration
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
depends a bit
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
Is there any solution to fix this, to determine where the traffic is coming from?
Isn't it simply a matter of having self-explanatory keys with the plugin name e.g?
The problem is that I'd like it so that if the player holds down the spacebar and then, while in the air, releases the button (press, release, press again), it would perform a double jump
Then listen to spacebar release rather than press
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?
Can you influence a mob's pathfinding as if it was being attracted / following a player with a food source?
indeed
use a pathfinder goal
if you look at a mob who does have that trait just copy the same goal
should just work
Yeah but like
yk how a cow
looks at you
when u go to feed it wheat
is that replicable?
i think thats a goal aswell
why did i send thatin 5 differeent messages bruh 😭
eh didnt really wanna touch NMS
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
updoot me on reddit
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
Paper has Mob#lookAt(Location, headRotationSpeed, maxHeadPitch)
Just gotta slightly modify the above code so that it's not using NMS but the API
Whats the latest packetevent? what do i put in pom.xml?
I mean that does not take longer than 10 seconds to search on Google
That literally could have just been two google searches lmfao
i've found it but its returning error thats why im confused
I mean not even. That can be done in 1 search
Should have started with that
What's the error and what does your pom look like
nvm turns out i forgot a fullstop...
Does anyone know why my ItemsAdder doesnt show vanilla titles?
ask in their support discord
They dont have support
They do
then the owner has to do it
Is it possible to increase the range of a bow arrow/increase the shooting speed?
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?
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?
I believe that to measure TPS you just need to do something like System#currentTimeMillis, say on tick 100, and then on tick 110 do it again, and the difference will tell you how many milliseconds were executed in 10 ticks; but I recommend not doing this because there are APIs to do this, like the one Spark probably provides, etc
should really PR that to spigot
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
yeah, sys current time milis isn't a good performance measurement taker
actually i'm not entirely sure
might be only for benchmarking purposes
why not?
but there is getServer#getTPS()
Not on spigot
Ticks are measured in milliseconds; I doubt the method is wrong about that order
I'd like to use either with millis or, wasn't there some event for TickFinish and TickBegin?
not on spigot
u can't use paper api?
don't wanna include a full-blown API just to fetch ticks
Schedulers run at the start of tick iirc
I'd like to support Spigot Servers
So if you just get the current time in a runnable each tick you could calculate tps
what i recommend is use paper methods if server is running paper. if not do ur own measurements
Or mspt which is more useful anyway
yeah that sounds fair
thanks
but, we should really PR that into spigot
I might be overcomplicating things, but the fact is that this way you'll have fewer calculations
MD has already said no
I am honestly super surprised that this isn't the case already
why wouldn't you want that lol
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
hm
mmm seems to be a paper method lol
tbh that's a weird argument
take it up with md ¯_(ツ)_/¯
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
seems like ServerTickRateManager is vanilla though.
You'll just have to re-create the method via NMS i guess lol
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
I could also get that SystemMillis method running and compare to Paper getTPS and see how close it is
I'd make a full conversion, but I'm busy with my own thing lol
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
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
yep that was the case back then
I think that's what paper's doing themselves at this point
but didn't remember if it was nms
They're kinda doing it weirdly though lol
MinecraftServer is obviously NMS
imma call that one a rare Paper W and go on 
What's TPS?
åbo football club
Only the tick duration line actually explains what it is
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
You'd have to increase the client too?
isn't that configurable by the server now?
i recall there being a tickrate packet now
Badlion did it iirc
using their client + playing on their server had a higher tickrate i wanna say
random 1.8 era stuff
neat
i could be makin that up i dont remember too well
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
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
i haven't tried, but i assume it would
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
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
lol
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
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
Yeah exactly, and this is the reason I didn't continue further because I realized I would have to find and adjust everything else and that was too much for me at the time
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
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
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
to be fair minecraft combat is a joke anyway so i don't know if it'd make much of a difference
never did like minecraft for combat
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
Not that I can say much. Currently trying to re-write a tokenizer & parser for batch lmfao
lol
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
ok sure then just put getMSPT in API
sure but what server is gonna process that
imagine trying to run a 500 mods modpack at 100 tps
💀
no CPU on earth will do that
yes it will
on modern cpus, clock cycle is 0.2 to 0.3 nanoseconds
so 100tps? sure can do it
you know exactly what I mean
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
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
its like putting a slow car on a fast freeway
I doubt that any cpu on the market will get 100tps on paper at above 50 players
10 players yes with awesome hardware
Which one, there's 8 in that screenshot
And why one of those
all of them
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)
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
@wet breach Found a repo for making compilers & interpreters, don't think it's what i need though lmfaooo
Yes, but god does it suck
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);
});
}
}
}
}
}
}
will have to look at this when I get home from work
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
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
Why only 10s and 1 minute though? Why not 5s? 5m? 15m?
What's the use case?
what if my max tps is 15 D:
😔
It literally does not matter, those are just values that make sense
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)
See:this
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
For example throttling chunk pregeneration speed based on the available tick time
in votifier what does that even mean?
someone voted? and what happened... what exactly connection reset?
I saw this in the minecraft client when you force stop the server
Not sure if it's the same thing
the other party's end of the connection blew up or it died somewhere in the middle
does this happen all the time?
XD
sometimes yeah.. its probably just bots
sometimes or all the time?
then its most likely a rate limit
the ip comes from a datacenter
it's an inbound connection
yea
vote sites are run by profoundly incompetent people
ill get rid of these probably once i set up my firework properly
oh inbound, then I suspect cipher disagreement then
right now im setting things up
i frequently have like 10% of my incoming votes not register because of this
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
yeah they're probably running their entire vote site on a 1vcpu webserver
that's how it feels at least
wouldn't be surprising
the vote site is yours?
yeah
pretty cool stuff
XD
its hidden on a subdomain in certain folder
but yeah bots can find it
and what exactly is the purpose of voting on your own vote site for your own server?
then if it happens only from your vote site or with it, then I will have to say its most likely cipher disagreement
Wait, what's a cipher disagreement in this case?
I worked with sockets and they were pretty straightforward
tls presumably
But still it should be on first connection and after that both have their private key for their communication
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.
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
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
XD
too many out of order packets can do it
Should have proper exceptions for those tbh
yea
novotifier api doesnt really provide any exception handling
it happens internally
the problem is that there is not really a way to determine what exactly caused the TCP RST though except maybe the cipher one but even then its still a bit ambigious.
if the application can determine more specifically, I agree it should use a more specific exception
That's bad
Is the code open source?
You could modify it for your needs
Yeah just make your own fork of it
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
a program that solves the collatz conjecture
simulate the entire universe
claude, simulate the entire universe (make sure u dont go over the free credit limit)
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
how to do that custom screens?
Dialog
thank you 🙂
That's what I told him a few days ago
First time seeing dialogs
Like no server uses them
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
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
I've used them for a thing or two
they suck for that kind of UI but they're ok for inputs
yeah
they feel more so like a simple UI replacement for commands instead
otherwise inventory UIs fulfill much greater roles
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
dynamic text is easy enough when you get the hang of it
the guys at work did bad apple on a chest ui
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
I mean..
how're you doing the ascents? do you have a separate font with a different ascent for each line?

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
this would probably work for what i need, i'll have to think about it some
ofc you played bad apple on it 💀
gotta downscale the resolution to like 55x36 and play the shrek movie
seems a tad jittery
yes, font magic
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
You can probably make Dialog's just as fancy with font magic
they were a bit limited
I need to create an AFK region plugin. Is there a WorldGuard API that could help me with this?
worldguard has an api, yes
not good, but it has one
https://github.com/OpticFusion1/TriggerZones this MIGHT be complete enough to be used too
Might be somewhat unoptimized for an afk region plugin since its likely gonna be query heavy
hmm alr thanks
i'll use triggerzones
And out of curiosity, why isn't Worldguard suitable for this?
imo its perfectly suitable (the api)
but depending on what your needs are, worldguard itself might be less suitable for you
why
Because you might not need all the other stuff WorldGuard offers
but if you're already using it on your server you might as well use their api
This seems to indicate that there's no API to determine if a player is in an area
From what I've seen, there aren't any events like ZoneEnterEvent or anything similar
worldguard definitely has an api to check if a player is in a region
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
I would like to use a TriggerZone already created by TriggerZoneEditor. Is that possible?
For the editor branch, that'd be an oopsie on my part since I forgot to include that lmfao
One moment lol
kk
TriggerZones#getEditor#getZone(String)
thx
Do you recommend using this plugin even though WorldGuard is being used for other things? I think yours is more efficient than theirs because it has fewer layers; for example, theirs has several layers like localplayer, etc
Depends, really. Theirs is certainly more complete having flags & the like but that's stuff I plan on implementing as well
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
It's for a conditions check within the plugin itself
if (zone.allConditionsMet(TriggerEvent.ENTER, ctx)) {
currentZones.add(zone);
}
And what is the purpose of this?
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
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
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
I'm lost 😭
what are you even trying to do
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
that could be quite laggy, Ig it could still work smoothly w some aggressive optimizations on one's region data structure
if I didn't fuck up the checks anyways
So I really don't know what the return is for
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
Yea, this is why my own impl ignores events & just allows setting things that happen on enter/join. It could have some sort of "still in zone" but I need to figure out a non-shit way of doing that in general lmfao
i'd just check all players every 10 seconds rather than bothering with enter/exit events specifically
Why? The PlayerMoveEvent is also a Bukkit event and the performance is ok
So if the player enters the region 1 second before the scheduler executes, then they will receive the reward
yea but it builds up cuz PME is invoked insanely frequently
sure, and they have to wait 10 seconds for the next reward
Praise be
if (to.getBlockX() == from.getBlockX() && to.getBlockY() == from.getBlockY() && to.getBlockZ() == from.getBlockZ()) {
return;
}
So if they're unlucky, they might have to wait 19 seconds for their first reward
no, at most 10 seconds
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
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
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
not at all what i said
tbh i think movement is lowkey fine if u for example compromise on using memory aggressively, palette ur regions and lets say u dont allow overlaps
perhaps
octrees are fast as well
i usually do this with chunk section sized buckets
yea
?paste
Looking to paste something? Try a code block or one of the following websites:
- https://pastes.dev/
- https://sourceb.in/
- https://mclo.gs/ (best for server logs)
This is the region impl I'm using https://pastes.dev/butlgWTtw4
My plugin wraps around this to include extra functionality
add an y axis to the buckets and it'll be fine
Yea, it's not perfect. It needs to be per-world too lol
If you can do a PR rq I can add both on top of the changes I'm working on rn
https://github.com/OpticFusion1/TriggerZones
i dont think there's much issue with that class, more so how u deal with the entire pipeline from R3 -> region
oh?
its just quite limiting ig, since u only allow for cuboids
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
is BoundingBox bukkits boundingbox?
This is something I planned on implementing as well lol
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
:,)
KEKW
Yea
This is for addCondition, not addAction right
worldguard i think uses an octree, but their region query logic spawns garbage objects so i don't quite like their approach
The code itself is flawed. v0.7 will fix that
But you used the same supplier for the actions
v0.7 also deals with that
Mine should be better, once I get per-world added and deal with the Y issue lol
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
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
A tree would probably be better but this was much faster to make :p
Well PR it for v0.8 lol
😎
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
@vagrant stratus im right?
Gotta take into account where that isn't the case too though 🤔
lol
They still can be any height, width, or length though lmfao
If you wanna do a PR, I'd suggest screwing with the editor branch as it has a WE-like in-game editor: https://github.com/OpticFusion1/TriggerZones/tree/feat/implement-editor and then PRing just the changes necessary onto the master branch
v0.7 will split it (and fix the logic)
TriggerZone#addRequirement
TriggerZone#addAction
once I'm happy enough w/ the editor, it'll be given a new editor branch & kept separate from the master branch
Does the editor look super fancy
the magic of the trees is that they adapt to density
Nah, it's just a simple command & right/left click for now
Just enough to do basic editing
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
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
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
Yea, no guarantee any plugin works properly when reloading w/ plugman
I know that the plugin works as intended on server restart though
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
Actually, I could probably have the plugin unregister them
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
in my defense, this was originally made for a proprietary game engine & was programmed initially as such lol
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
I'm testing 0.7 rn so I can quickly double check and verify lol
Definitely caused by plugman though. Probably breaking other stuff too
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
all my minigames are reloadable
the /arc reload command for example just does plugin.onDisable plugin.onEnable
But when I create a registerListener in my plugin and then disable it, the listener no longer works
Yea, as would be the case for my own engine lol
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
Working on it!
but it is already possible lol
@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
it takes like 2 minutes lol
in my defense, I just haven't bothered @drowsy helm LMFAO
what are the updates?
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
i see
Yes, because you pass it your plugin so the event bus knows that listener is part of your plugin; when your plugin disables, the event bus automatically unregisters all listeners associated with it, so it no longer gets called
Triggerzones however does not take your plugin as a parameter and so cannot automatically associate your listener with your plugin to unregister it
^ 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
I always just register listeners in onEnable and it works fine
Since reloading will call it again
Hi any idear how they remove the player inventory for custom gui ?
https://www.noelshack.com/2026-10-3-1772661666-image.png
Yea, that's basically what they'd have to do here.
Add their stuff to the correct zones on enable & remove them on disable
is it open source
can just contribute it
@sly topaz
https://github.com/OpticFusion1/TriggerZones The library
https://github.com/OpticFusion1/TriggerZones-Editor The editor
no license on the editor 👀
You'll be waiting a bit though, as I'm working on v0.3.0 of the editor lol
You can now toggle the ability to see the zone 😎
Needs more display entities
Nah. Particles are good enough lol
3/10
no u
support for multiple zones + selection 😎
I gotta clean this up though lmfao
That would be so good with colored display entities!!!!11
The annoying part is dealing with unloading
Particles are much simpler in that regard
Sounds like it needs PR'd
@young knoll get to work KEKW
Just pushed updates for the library & editor
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
generic typing?
Instead of using context each time attach helpers
Generics surely
it happened again, from exactly the same ip
bruh
ill have to add a passthrough only for the web server for my local db server
o.O
I fixed it
well that is good
Hey im implementing ConsoleCommandSender and then running Bukkit#dispatchCommand to capture output of a command, but I dont get any output. heres my code:
https://pastebin.com/Q9D8Gve9
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
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
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
eyeballing it, it should work, and i've done something like this prior, though i used a CommandBlockSender rather than the console sender
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
so just return null for the getBlock method?
i don't remember
what kind of debugger do you mean
basically look at nms and see what it calls on the sender you pass to dispatchCommand, and implement those methods appropriately
ide debugger, like being able to pause the server tick loop and look at the call stack and shit, breakpoints, all that jazz
sorta but the support depends on your jdk
forgot how though
it's pretty simple
my server is remote
you just pass a flag to the minecraft server telling it to bind to some debugger port
ah
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
and then in your ide you tell it to connect to that port
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
or do, and then likely quickly regret it lol
whats that
how do i use that
basically exactly what you're doing, but over a network
login, run command, get command output
I saw something like this in server.prop
Never tried it tho
There's password, good
there's also some new "server management protocol"
Hm?
can i see in the console whether or not my debug is running?
If there's messages sent to the console pretty sure
Nice
it looks a lot like the remote console but for shit like whitelisting and changing gamerules or something
seems a bit redundant but whatever
the server console? no
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