I'm still in a general conflict with this sorta thing, the lack of means to ensure that we get behind all data saves is generally a nuisance, while 99.999999999999...% of the time this is not going to cause issues, there is still a small technical risk of mangling the data on the disk
#paper
1 messages · Page 6 of 1
Expected behavior
- Whenever a dispenser dispense a bucket of water into a nether portal, the BlockDispenseEvent should trigger
Observed/Actual behavior
It does not trigger the BlockDispenseEvent.
Steps/models to reproduce
Testplugin:
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockDispense(BlockDispenseEvent event) {
this.getLogger().log(Level.INFO, String.valueOf(event.isCancelled()));
this.getLogger().log(Level.INFO, ...
I cannot replicate that event being called in 1.20.1. Are you sure the untrack event was called for players moving to another world? I see the remove entity packet being sent, but I don't think the event is being called.
Fixes https://github.com/PaperMC/Paper/issues/10107
Moves the untrack event call back to the Entity#stopSeenByPlayer method. It was originally added there, then moved when the track event became cancellable. But the untrack event wasn't (and can't) be made cancellable so it should've been left.
Requires testing
Did some basic testing. I only tested the number format on the score and not on objectives. But the original code in my first commit was tested on the objective in another plugin as well. (Because that code is used in a paper fork of mine as of right now) I would assume that works.
Getting (and therefor converting the format back) works as well (which can be sen by the output in the console)
Some further testing might be required but as far as I can see everything wo...
Expected behavior
The CustomModelData tag should be persistent for the item.
Observed/Actual behavior
The tag is removed upon any update to that item slot.
Steps/models to reproduce
Give yourself an item with the CustomModelData tag
Example:
/give @s minecraft:honey_bottle{CustomModelData: 1b}
Check that there is tag data present using Advanced Tooltips or/paper dumpitem
Move the item to another slot in your inventory
The CustomModelData tag is removed from the ite...
Are you sure the untrack event was called for players moving to another world?
Yes. But I may be wrong, in what version it was called — the issue was only noticed yesterday..
I'm used it since ~1.19, and I am sure that it was called in all cases before.
The source of the issue is that spigot does the check if (tag.contains(CraftMetaItem.CUSTOM_MODEL_DATA.NBT, CraftMagicNumbers.NBT.TAG_INT)) instead of if (tag.contains(CraftMetaItem.CUSTOM_MODEL_DATA.NBT, CraftMagicNumbers.NBT.TAG_ANY_NUMBER)) in org.bukkit.craftbukkit.inventory.CraftMetaItem when reading the custom model data, line 384
While certainly valid, I am unsure if fixing this is worth it.
You can fix this by literally just using /give @s minecraft:honey_bottle{CustomModelData: 1} and would be just fine.
The b suffix, indicating a byte value, would be lost as well in the current item meta system which would the same issue as #7631 and not quickly resolved either.
So even if we fix this, your item stacks would then be changed by the bug #7631 describes.
The way easier solution here is to just not suffix the n...
Should this also include calls for CandleCakeBlock being ignited and extinguished ?
I think this can be left for another PR. It's not super clear if/where an event for igniting should be called as bukkit already has the BlockIgniteEvent. Perhaps a counterpart BlockExtinguishEvent instead? Either way, not clear, can be done later.
983377b Correctly check if bucket dispenses will succee... - Machine-Maker
Is your feature request related to a problem?
N/A
Describe the solution you'd like.
Call EntityChangeBlockEvent when players extinguish a candle or a candle cake.
Describe alternatives you've considered.
N/A
Other
No response
I don't claim to fully grasp the activation system, but can't we make it activate at least every 40 ticks? It looks like the damage source for freeze is only applied every 40th tick for that entity. I feel that's better than having it fully active.
@lynxplay the problem is, that many downloadable maps use the byte tag, and so they will break when played on spigot/paper servers.
Yea, agreed. After some more discussions we'll fix this as best as possible: "Convert to an int" pretty much.
While not perfect, the bug is then "reduced" to https://github.com/PaperMC/Paper/issues/7631.
58e120b [ci skip] Remove extraneous diff added in 1.20.... - Machine-Maker
The stack changes from 1b to just 1, but no avoiding that for now, at least it's not removed entirely.
Yeah it’s not worth going through that effort
816bacc Call EntityChangeBlockEvent for cake eating (#1... - Machine-Maker
692db0c fix CustomModelData being removed (#10113) - Machine-Maker
Partial fix was merged in 692db0c81d7637faedd055631b0774461c13d8e6, as stated above this means items spawned in this way will convert to minecraft:honey_bottle{CustomModelData: 1} once going through the item meta system.
This is then a duplicate of https://github.com/PaperMC/Paper/issues/7631.
The pushed commit however prevents that data from being lost (now it is just changed) so this issue is considered closed with a "duplicate in 7631" attachment :)
It looks like there is nothing more to do for this PR. Most of the recent commits are rebases for newer MC version. What prevents it from being ready for review / unmarked as draft?
Really hope to see this soon added into paper :)
Expected behavior
- Using an RNG Algorithm like
Xoroshiro128PlusPlusworks fine
RandomGenerator rng = RandomGenerator.of("Xoroshiro128PlusPlus");
Bukkit.getLogger().info("Number: " + rng.nextInt());
Observed/Actual behavior
- Using an RNG Algorithm like
Xoroshiro128PlusPlusdoes not work - Only the Legacy Algorithms like
RandomandSplittableRandomwork
Steps/models to reproduce
- Create Basic Plugin
- Run Server
- See Error
[08:56:32 ERROR]: ...
if I had to guess, I would imagine that this is generally down to how the program is bootstrapped, i.e. plugins and MC itself are launched in their own classloader which doesn't inherit the app/system/whatever it's called now classloader
afaik this is only an issue when the server is ran through paperclip and not with the bundler jar, but at the same time craftbukkit's jar bootstrapping mechanism does not align with vanilla's (by using the app's CL) whereas paperclip's does (by using the app's parent CL)
I tried with both, jpenilla's run-server gradle plugin, and just java <...> -jar <downloaded paper jar>, both of those are/use paperclip then, i assume...
@Owen1212055 I think I have been troubled by this problem for a long time, probably for about a month. Today I discovered the same problem again in a new world, that is, in certain locations in the ancient city, Sculk Shrieker will recover after being destroyed. After multiple attempts, a prompt to disconnect from the server will appear. Likewise, jumping or flying move state changes near these locations will disconnect the server. I hope the PaperMC can fix this bug as soon as possible.
...
We need means to reproduce the issue, without such means, we cannot diagnose what is going on and implement a proper solution
Currently you cannot "unignite" a creeper or change its swell speed without NMS.
This PR allows you to do that.
This is my second Paper PR, so let me know if I did anything wrong that needs changing :)
Please do not open pull requests from the master branch, create a new branch instead.
[PaperMC/Paper] Issue opened: #10116 Paper Plugin dependency is not successfully completely resolved
Expected behavior
Paper manage to download the dependencies at start.
In my behavior redisson 3.25.2 with all peer dependencies could be downloaded.
Observed/Actual behavior
Paper manage to download the dependencies at start.
In my behavior redisson 3.25.2 with some peer dependencies are downloaded but not with all.
Steps/models to reproduce
- Create a simple java project with maven/gradle
- Add following dependencies
implementation("org.apache.maven:maven-re...
known issue internally
diff --git a/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java b/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
index 9af07d168..70f352630 100644
--- a/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
+++ b/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
@@ -73,6 +73,7 @@ public class MavenLibraryResolver implemen...
Probably Spigot have the same issue.
The maven repository sessions used by the maven library loader requires the java.version property to later evaluate the active profiles of dependencies when downloading them during the plugin loader logic.
This commit fixes this by passing all system properties as a hopefully future-proof way to provide the required data to said session.
Resolves: #10116
Currently you cannot "unignite" a creeper or change its swell speed without NMS.
This PR allows you to do that.
Let me know if I did anything wrong that needs changing :)
I'm concerned that it seems this value could be reset every tick in the SwellGoal#tick method. So if you set the swell dir to 1 and the creeper didn't have a target, it would immediately get set back to -1. Can you outline some examples or usecases where the API setting the value does have an effect? If there are such examples, then the behavior should probably be more documented in the javadocs.
As mentioned in the PR description, calling Creeper#setIgnited(false) doesn't really work, as the swell direction isn't changed. So shouldn't that method be modified to set it so that unigniting actually works?
You're right about the value being reset every tick in the goal, it may be better to just have a fix for Creeper#setIgnited(false) instead of allowing the swelldir to be changed. The reason I hadn't noticed was because I wrote my own custom creeper goal.
Haven't tested it yet, but something like this?
@Override
public void setIgnited(boolean ignited) {
getHandle().setIgnited(ignited);
if (getHandle().getSwellDir() > 0 && !ignited)
getHandle...
Expected behavior
The chunk to generate/load without issues.
Observed/Actual behavior
Chunk system error when generating the chunk: https://pastes.dev/H3ujZPDylz
Steps/models to reproduce
-
Download and add the attached datapack. It generates a world full of structures with a camel with
LastPoseChangeof less than 0: cameeelll.zip -
Start the server.
-
Server will crash as soon as it tries to generate...
if the sole intent for exposing a method is to fix the behavior of another method, it would make more sense to just fix the OG method, imho; if this had some unexpected side-effect, that would be a different matter, but, that doesn't sound to be the case?
I'm not 100% aware of all the implications here, however, nothing against also exposing a value even if its only real use would be inside of custom AI or whatever
Donno if we need to have a diff on the event call? But lgtm
Bump on this - would be good if this API was noted as not thread safe in the JD as we had a server crash because of this as well. Would've seen the note if it was there as I end up checking the JD for this method occasionally.
Stack trace
https://paste.gg/p/anonymous/01c13516f8854d5a875b373b5580e155
Plugin and Datapack List
[18:01:15 INFO]: Bukkit Plugins:
[18:01:15 INFO]: - Analyse, AntiPopup, AreaShop, ChangeSlots, ChatItem, Chunky, ChunkyBorder, Citizens, CMCEvents, CMCLinkManager
[18:01:15 INFO]: CoreProtect, CrashClaim, CrashPayment, CreativeManager, DecentHolograms, dynmap, dynmapHider, DynmapWaystones, Essentials, EssentialsSpawn
[18:01:15 INFO]: Fan...
CraftLimitedRegion loads and stores entities in the protochunk and doesn't parse the entities from NBT each time. This requires that a new instance of CraftLimitedRegion is created each time before passing it to an api consumer and then saving/clearing it afterwards.
CraftStructureTransformer was creating a single instance for an entire structure place which was causing entities to be deleted so no structures would spawn entities.
Demo to cause the issue. Just add this listener ...
This is most likely caused by one of your plugins doing something off the main thread they shouldn't. One of the more likely causes is playing a sound to a world asynchronously which plugins like to do without realizing that in most situations, its not a thread-safe operation.
We added more specific checks for sounds in 1.20.4 that will show the offending plugin, but as you are on an earlier version, there is no way to be sure what plugin caused the issue. If you have a plugin which you k...
Expected behavior
Running /place structure ... with some structure that spawns entities like a village should spawn valid villagers.
Observed/Actual behavior
The villagers spawned still have some generation flag set restricting the valid API to use on them.
Steps/models to reproduce
- Create a test plugin with 2 event handlers setup as below. You need to add one passthrough
EntityTransformer
@EventHandler
public void onEvent(ChatEvent event) {
final Col...
Ok, finally got around to testing this. Need to actually set the generation bool to true on the entity instead much earlier before nbt loading happened. I also removed 2 pairs of overrides of addFreshEntityWithPassengers so the delegated addFreshEntity is actually called for each passenger.
Expected behavior
AsyncStructureGenerateEvent has transfomers for modifying added entities or placed blocks in EntityTransformer and BlockTransformer. The world interface provided should be RegionAccessor to reflect that structure generation can happen to WorldGenRegion and ServerLevel.
Observed/Actual behavior
These functional interfaces provide a LimitedRegion to interact with the world during that process. This reflects an incorrect implementation by upstream whi...
Block/EntityTransformer for AsyncStructureGenerateEvent need to accept World and LimitedRegion instances because structure generation can happen to both ServerLevel and WorldGenRegion instances.
Fixes https://github.com/PaperMC/Paper/issues/10124
I also changed the constructor param type for CraftLimitedRegion so this doesn't happen again. We will catch this issue at compile time then.
ae001ae Fix untrack event not being called for all 'unt... - Machine-Maker
I'll just fix the og method then.
Stack trace
log: https://pastebin.com/raw/hCTZNtas
Plugin and Datapack List
Datapack:vanilla,file/bukkit
Plugin:none
Actions to reproduce (if known)
https://www.youtube.com/watch?v=cNlSxx07x2M
- get /give @p shulker_box{BlockEntityTag:{LootTable:"^"}} 1
- place shulker box
Paper version
This server is running Paper version git-Paper-318 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 9271ee7)
You are running the latest version
Previous versio...
Yes, you created an invalid resource key, this is 100% expected behavior here, not a bug; don't create illegal data.
Currently the secret can only be specified as string in the config. This makes it almost impossible to run the server within a containerized environment like Kubernetes. Also I don't want secret data to be specified along with 'general' data.
This PR aims to add the functionality to load the secret from an external file (like it is already the default in velocity)
FYI: I only changed the files GlobalConfiguration, VelocityProxy and PaperConfigurations I don't know why rebuildPatches also changed the other patches.
Being frank, this has kinda been on the todo list for a while, but if we wanna do this, we would want to maintain consistency with velocities current expected behavior, i.e. the secret if already set should probably be migrated to the file, and we should follow the file naming of velocity so that people can just copy the file over and save confusion
Thank you, I'm pretty sure this was the error I linked on discord a few days ago
@electronicboy I added functionality to migrate in-config secrets to file automatically. I hope this fits what you meant.
https://github.com/electronicboy/Paper/commit/4e672d574c5eeacf58971c6125bc8e83945b7457
Not 100% on it, but I generally feel that that would be more closer to making me happy here
7eaff48 [ci skip] Replace some magic values with consta... - kennytv
Expected behavior
Observed/Actual behavior
Steps/models to reproduce
https://github.com/PaperMC/Paper/assets/98388174/86c812ca-a487-462c-a047-92cff55b5827
Plugin and Datapack List
datapack: vanilla and file/bukkit (world)
plugins: none
Pape...
paper has 0 control over the client, so I'm not really sure how this is our issue
You can only get spawners with custom nbt as an operator, at that point you have better ways of lagging or crashing clients, so this is a non-issue
Is your feature request related to a problem?
Yes! We want to make than one shulker can't summon more than 3 other shulkers when a shulker bullet hits him. But currently there's no way to get the "parent" shulker and, for example, allow or cancel spawning of new shulker based on parent's PDC value.
Describe the solution you'd like.
Add cancellable ShulkerDuplicateEvent, that contain a getParent method and, if it's easy to do, getBullet.
Describe alternatives you've consi...
This cannot be solved using https://jd.papermc.io/paper/1.20/org/bukkit/event/entity/CreatureSpawnEvent.html with the Reason of https://jd.papermc.io/paper/1.20/org/bukkit/event/entity/CreatureSpawnEvent.SpawnReason.html#BREEDING ?
there's no way to get the "parent" shulker
By default, exceptions during command execution are not logged unless the Commands.java logger has debug logging enabled. This logs them if the server.properties debug=true.
This also actually outputs the stacktrace in the error message sent to the player. We may want to not do that, only log the exception to the console log.
19a6202 Fix experience & improvements to block events (... - Owen1212055
8379027 Fix cmd permission levels for command blocks (#... - Machine-Maker
a93acc4 Fix EntityChangePoseEvent being called during w... - Machine-Maker
I'm not sure its appropriate to have the nms class name in the javadoc comment, I'm fine with it but it does seem odd to have in the API.
Not 100% on it, but I generally feel that that would be more closer to making me happy here
We've just started using this patch to solve an issue we reported in #paper-help, world saving no longer lags for us! :)
Stack trace
[12:04:31] [Netty Server IO #1/ERROR]: Packet encoding of packet ClientboundSetEntityDataPacket (ID: 86) threw (skippable? false)
io.netty.handler.codec.EncoderException: java.io.UTFDataFormatException: encoded string (".$$aaaa...aaaaaaa") too long: 65537 bytes
at net.minecraft.network.FriendlyByteBuf.writeNbt(FriendlyByteBuf.java:612) ~[?:?]
at net.minecraft.network.FriendlyByteBuf.writeItem(FriendlyByteBuf.java:657) ~[?:?]
at net.minecraft.network.syncher.Entity...
The javadoc for BlockDropItemEvent is at best misleading, at worst just plain wrong.
Called if a block broken by a player drops an item.
No, it's also called for just breaking glass with your fist (with an empty item list)
This event will also be called if the player breaks a multi block structure, for example a torch on top of a stone. Both items will have an event call.
No, all items broken because of immediate block updates will have their drops contained in this event's li...
Should I create a new PR and close this one? Seeing as I'm doing something different (fixing an existing method)
Add a cancellable shulker duplicate event. Provides both the parent and child in the event.
Fixes #10129
a58e29d Fix a borked update of 'Properly handle BlockBr... - Machine-Maker
I'd generally defer this to owen as he is more aware of the mob AI API type stuff, but, imho, we should do both, add the method and make the old method work as expected
Expected behavior
When broke an beehive(or beenest) in creative mode, the item is generated in the center
Observed/Actual behavior
when you broke the beehive(or beenest), the item was generated in a strange location, not in the center.
Steps/models to reproduce
 method and a getPower() method for the size of the conduit prismarine structure or beacon pyramid.
This event would be called ...
I think I am closing this in favor of https://github.com/minecraft-dev/MinecraftDev/pull/2122 since it got merged recently. If you ignore this warning there is really nothing else we can do.
If someone still thinks this is something worth adding (in another form than how it works at the moment) just let me know :)
you should instead file a bug with mojang
this can all be just new Event().call I think, also, generally events are fired before something is added, why do you call it after addFreshEntity?
seems strange to accept entity here when you always cast anyways
Stack trace
paste your stack trace or a paste.gg link here!
Plugin and Datapack List
.
Actions to reproduce (if known)
.
Paper version
.
Other
.
Resolved requested changes. Only thing I was unsure of was if I need to discard the entity but I assumed I did.
This needs an Override annotation
you forgot to remove the cast
This is the protected entity field from the EntityEvent class, that needs to be casted
Currently, Minecraft waits a tick before syncing effect visiblity/glowing. This is noticeable when adding entities into the world with effects. So, this main logic moves the dirty effect logic into the actual updating logic. This causes effect visibility to be updated correctly.
Additionally, mob effects are not correctly added when read from NBT due to their attributes not being applied. This is a problem for entities that have effects already added before being ticked for the first time....
Just triggering the updateEffectVisibility "if dirty" will not update the visibility status. I assume that the boolean needs still be set. Same for the other locations where the boolean was set previously.
Notice updateEffectVisibility will set effectsDirty = true
I would further clarify that this is the new entity being created, and that it does not exist in the world yet.
This is interesting to me... Does this happen elsewhere for events relating to the spawning of entities? If it does, then you can leave the discard, I just don't remember exactly how the handling of this is done elsewhere.
Ah thanks missed the second method in diff.
That was why originally I did it after the add fresh entity. I could not find any other examples similar to this scenario. Not discarding it seemed wrong since the entity would remain unmarked yet also unadded to the world.
How did you set the display name/get the item?
i used nbt editer
https://www.curseforge.com/minecraft/mc-mods/nbt-editor
Thanks for some reason didn't see entity breed event had the child.
I like the concept for this event. I think the name probably needs some work to further distinguish it from BeaconEffectEvent which is fired for each player an effect is being applied to for beacons.
We have a similar PR open for spawners adding SpawnerPlayerSearchEvent, allowing plugins to change how spawners detect players in range and I think a similar approach for this would be good.
(maybe should write "child" with a small letter, similar to "parent" in the corresponding method just below?)
Any update on how it got fixed? I am having the same issue too right now and I really need help
see proxis comment, please join our discord if you need help instead of bumping a 3 year old closed issue
Is your feature request related to a problem?
[WorldGuard]'Decorated Pot' does not have the intended protection
https://github.com/EngineHub/WorldGuard/issues/2054
Describe the solution you'd like.
it will need support from the server itself. likely worldguard will immediately protect it once spigot/paper/etc add proper events for
Describe alternatives you've considered.
↑↑👆↑↑
Other
https://github.com/EngineHub/WorldGuard/issues/2054
I'm now stopping others from brea...
Expected behavior
Using /whitelist add on an offline player adds that user to the whitelist.
Observed/Actual behavior
Vanilla gives back error "That player does not exist"
Steps/models to reproduce
Execute /whitelist add in any Paper version besides 1.20.4
Plugin and Datapack List
[18:04:18 INFO]: Server Plugins (0):
Paper version
[18:03:41 INFO]: Checking version, please wait...
[18:03:42 INFO]: This server is running Paper version git-Paper-196...
It will be up to mojang to correct these endpoints, we are not really going to back port such fixes.
Added a FallingBlockDropAsItemEvent to allow modifying or cancelling the item that is dropped when a falling block either expires or is unable to form a block.
Stack trace
[13:36:26 ERROR]: Packet encoding of packet ClientboundSoundPacket (ID: 102) threw (skippable? false)
io.netty.handler.codec.EncoderException: String too big (was 65525 characters, max 32767)
at net.minecraft.network.Utf8String.write(Utf8String.java:35) ~[paper-1.20.4.jar:git-Paper-381]
at net.minecraft.network.FriendlyByteBuf.writeUtf(FriendlyByteBuf.java:694) ~[?:?]
at net.minecraft.network.FriendlyByteBuf.writeUtf(FriendlyByteBuf.java:690) ...
[PaperMC/Paper] New comment on issue #10143: EncoderException in ClientboundSoundPacket of noteblock
You mean, you edited the NBT of a players datafile on the server in order to reproduce this?
[PaperMC/Paper] New comment on issue #10143: EncoderException in ClientboundSoundPacket of noteblock
The mod they used seems to be a client side mod that uses the creative set item packet to modify the NBT data of items. So theoretically this could be reproduced to creative servers, although almost any sane server owner would have plugins in place that prevent this sort of stuff
[PaperMC/Paper] New comment on issue #10143: EncoderException in ClientboundSoundPacket of noteblock
oh, it was the other reported issue in which there was the question over how the server was even able to get that into the server, this one is more obvious
Hitting a decorated pot (or any of the other blocks mentioned) will call a ProjectileHitEvent. This allows you to get both the hit block and the projectile, and the projectile will provide the shooter.
Is there anything that is missing that could be provided by having a specific event for breaking blocks with a projectile? It seems to me that the current ProjectileHitEvent would provide all the information a protection plugin needs, but maybe I am missing something.
Maybe EntityChangeBlockEvent I guess ?
Given the arrow changes the block. I presume WG would pick that up ?
Unless I am missing something here but https://jd.papermc.io/paper/1.20/org/bukkit/event/entity/EntityDropItemEvent.html exists 😅
Chorus Flower Block which has the same behavior does call EntityChangeBlockEvent. Though this looks like something that would be done upstream.
Not exactly because it doesn't always represent a block actually. See the javadoc comments, where depending on the entity's position it returns the bottom of their hitbox.
I am not sure actually, opinions?
I like the new names of the methods (full "position" instead of "pos").
Expected behavior
When a block is mined- including shulker boxes as well as ores and blocks like stone and netherrack, they normally drop and don't despawn until the 5 minute timer runs out. As we have no plugins that affect drops- and have removed all plugins from the server during testing, the default timer should apply to dropped items.
Observed/Actual behavior
Mined items are not dropping in a specific chunk section in our world.
We don't know if it's happening in other loc...
Might need better naming.
tnt.getBlock() I'd expect to return a block somewhere, idk maybe the block the tnt originated ?
This is more like the displayed block data ?
This adds a new way to define the rendered block state on a primed tnt since 1.20.3.
Superseded by https://github.com/PaperMC/Paper/pull/10146
(names are better anyways, and has preconditions)
The stars aligned and we managed to PR the exact same thing at the almost exact same time, very spooky. But, they did it better. 😔
[PaperMC/Paper] New comment on issue #10144: Mined tile drops despawning in a specific chunk section
Resolved after further looking through the world, not a paper issue.
What the hell? This is kind of a big issue.
Seems like I was able to convince a mod to reopen the issue by pointing out that the issue is in the API (it was not clear from the bug report itself).
Since it affects all versions of Minecraft below 1.20.1, hopefully they will look to bring back that endpoint.
For anyone lurking, https://bugs.mojang.com/browse/MC-267771 is the opened issue.
But yea, not much we can do here outside of manually updating all older versions to use the new API layout.
Is your feature request related to a problem?
This was originally mentioned by Prototype464 in issue #7347. It's been 2 years since their inquiry into this. As they have stated, it would be great to make some datapacks per-world. For example, applies something like Terralith to a resource-only world. I will note the end goal here is well-put by Prototype464 in their issue.
Describe the solution you'd like.
The ability to use datapacks per-world on a server. For exampl...
This is slightly more feasible with the introduction of the configuration stage. That essentially means the player leaves the server and re-joins, but to the client it is just a loading screen.
No such API exists for putting a client back in that configuration phase as of yet and it can't be added very easily without reworking a lot of the changes craftbukkit has made over the years to how players are created. It's possible, but not tomorrow and probably not the next day.
These values always apply to the world the player is in correct? If that is the case, Block or Location seems more appropriate. Giving extra context in a returned value is fine. The problem with Location usually shows up when it is a parameter rather than a return value.
Hmm okay, I think Location is fine then. I would just rather stay to more primitive types.
+ * Gets the position of the block that is currently under the entity.
to be honest, I would rather have the web team focus on modernizing and stabilizing the api instead of maintaining legacy endpoints. if you need a working whitelist on those legacy versions you can just use a plugin.
You could, but it doesn't just affect Paper, the issue is in both vanilla server and modded too. So now everyone needs to develop a plugin or a mod (vanilla can't do anything, except manually editing whitelist.txt). Whitelist is also the only blocker from random people joining.
I could develop something for my modded server, sure, but I am sure there are plenty people who don't even know what the problem is or where to write about it or how to fix it.
Besides, the broken version includes 1....
Expected behavior
Plugins should be disabled and world saved when something bad happens with main thread (cause by plugins).
Observed/Actual behavior
As of Java 20 Thread#stop always throws UnsupportedOperationException what interupts emergency server stop process when main thread got stuck(mostly by plugins), so plugins will not be disabled...
Adds a removal reason to EntityRemoveFromWorldEvent. The RemovalReason enum mirrors the NMS Entity.RemovalReason, except that the methods shouldDestroy/shouldSave are renamed to willDestroy/willSave. Due to the chunk system rewrite, unloaded entities are not set as removed with RemovalReason.UNLOAD_TO_CHUNK, so currently if the removal reason is not set and the entity is inaccessible, it'll default to RemovalReason.UNLOAD_TO_CHUNK as the removal reason.
[Paper] Branch feature/lifecycle-event-system was force-pushed to `2f6c78d`
[Paper] Branch feature/lifecycle-event-system was force-pushed to `53524cf`
You can see examples of this being used in both the plugin bootstrap and plugin JavaPlugin.
Upon testing this found that clicking the recipe book item does not move the items in your inventory to the crafting grid.
Ingredients have custom model data, lore, and attributes set.
[Paper] Branch feature/registry-modification was force-pushed to `26a19a5`
Should be fixed by vanilla in 1.20.2+
Unable to reproduce the issue using the steps provided
This seems to occur due to chunk gen happening while the server is shutting down if I'm reading it correctly, ServerLevel#onBlockStateChange will try to schedule the poi access onto the main thread but the runnable ends up being ran immediately since it's stopping
Expected behavior
The Block Update Chain should not be triggered by other blocks placed when BlockPlaceEvent is cancelled.
Observed/Actual behavior
The Block Update Chain is triggered by a block placed even though the BlockPlaceEvent is cancelled. This leads to some blocks breaking when set with worldedit or triggering redstone signals (e.g in protected areas with worldguard)
Belows case: The redstone torch can trigger the update chain of minecraft. It is an indirect block updat...
Expected behavior
Observed/Actual behavior
Steps/models to reproduce
- Fill your inventory with dirt (/give @p dirt 6400)
- Go into third person with F5
- Use /kill
- See items being spread out way too far
Plugin and Datapack List
No plugins.
Paper version
git-Paper-381 (MC: 1.20.4)
Other
I'm pretty sure vanilla has a thing where if you die of fall damage after falling for very long it spreads...
What is the expected behavior? Is this a previous version? We made some changes to item drops that caused this behavior, however, this mirrors vanilla behavior. Dying in vanilla causes items to drop in the same fashion.
Clarify that Block#getDrops only returns 1 possible set of drops for that block type and that multiple calls to getDrops are not guaranteed to be consistent due to the fact that its just running the loot table for the block type.
Accepted, caused by the onRemove logic on the RedstoneTorchBlock being called when the original state is updated.
Expected behaviour was tested on spigot. I can test vanilla too if you want.
Nevermind I was wrong. This might be a vanilla bug then. Like I said I think it's only supposed to be like this when you fall from very high and die of fall damage. I'm pretty sure that's how it worked in the past. Lots of players on my server complained about this change after I updated from 1.20.2 to 1.20.4.
As far as I can tell, this is a feature, not a bug. I found an issue reporting that items stopped flying farther away here: https://bugs.mojang.com/browse/MC-156766. It was then reported fixed, meaning that items are supposed to fly far away on player death regardless.
The reason you saw the change when you updated, is that we fixed a long-standing bug that craftbukkit/spigot created by not making the items spread far out.
Here is it in 1.3.2, spread out far just will a /kill.
!...
Yeah I also tested older versions and it's the same there too. I could have sworn that items didn't always spread out as much. I guess both me and my players just misremembered? Seems like a weird coincidence but this wouldnt be the first time things go unnoticed for so long.
I could have sworn that items didn't always spread out as much.
I mean if you haven't played pure vanilla for a long time, the drops have been clumped together on craftbukkit/spigot/paper for a long time, so you could've thought it was intentional.
Will close as works as intended.
Yeah you're right. Just checked an old paper 1.19.4 and on there items dont spread as much. Must have been a spigot bug that was at some point fixed by paper.
I expected Player.hideEntity() to keep player listed in tab. I tried working around this using Player.listPlayer(), however you can't list hidden players. (I am getting IllegalStateException("Player cannot see other player")). If someone have a workaround until this...
It's a little trickly. hideEntity and hidePlayer do the same thing right now, and hidePlayer has existed WAY longer and plugins rely on that completely removing the Player from connected clients. If we reversed course and made it so it didn't completely remove other players, then vanish abilities would be broken as any client would still know that player was online.
Since just separate tab list hide was added pretty recently by mojang, I think new API is better for that instead of ch...
e98d5fd add RegistryAccess for managing registries - Machine-Maker
[PaperMC/Paper] New branch created: feature/RegistryAccess
Part of https://github.com/PaperMC/Paper/pull/8920
Required to separate the managing of API registry instances from CraftServer as CraftServer won't exist with future bootstrap-related APIs like brig commands.
Add player join event handler in TestPlugin
Enhance the TestPlugin by adding an event handler for player join events. Now, whenever a player joins the server, a welcome message is sent to the player.
This improves the functionality and interaction of the TestPlugin with player events.
Thank you for your contribution, however, changes like these aren’t really necessary. Take a look at our issue page for possible good first issues for contribution.
Thank you! 😊
This adds nothing of functional note and just blasts the git history of the file in the name of tabs vs spaces
Expected behavior
When fire spreads, BlockSpreadEvent should get executed.
Observed/Actual behavior
BlockSpreadEvent does not get executed when fire spreads.
Steps/models to reproduce
Register event:
@EventHandler
public void onBlockSpread(BlockSpreadEvent event) {
Bukkit.broadcast(Component.text(event.getBlock().getType() + ""));
}
Place down blocks like planks that are burnable. Set fire to the burnable blocks and observe as the fire spre...
I see BlockSpreadEvent being fired for it, as well as BlockBurnEvent. BlockSpreadEvent is fired when a fire block is going to be created in a previously empty block. But that isn't all that happens for fire, BlockBurnEvent is fired when a block is immediately replaced with a fire block.
a80d31b Log command execution exceptions if debug=true ... - Machine-Maker
Adds an unsafe method for getting the underlying colour definitions for spawn eggs, based on the entity type. I recognise this is probably a fairly niche thing, but it can be useful to have a consistent way of getting some colours for entities when doing certain visual effects.
I've added this to UnsafeValues as it's accessing data directly from the SpawnEggItem class rather than reading data from an individual ItemStack's meta, although I'm happy for it to be moved somewhere more appropri...
Expected behavior
For ItemMeta implmentations such as BlockStateMeta to not add default NBT data/have a way to clear that data.
Ideally BlockStateMeta/ArmorStandMeta/whatever other implementations have this issue could automatically exclude the NBT value if it's the default, but assuming that's impossible to do without breaking backwards-compatibility in some way, making the setters nullable/some clear method (maybe even one to automatically check and remove default values?)...
We could add something to BlockStateMeta to clear the block state, which would just remove the BlockEntityTag entirely, but we don't control what is inside of that tag. That is just the full serialized BlockEntity. But doing that automatically doesn't seem feasible. Each BlockEntity type has it's own "default" nbt values so we'd have to create some way to know what the defaults were based on the type, and that is a massive pain to maintain.
I agree with potentially clearing the block state.
However, I STRONGLY agree with Machine here. The concept of "default values" is flawed. With Item Property API, keeping that legacy behavior was very difficult... It is difficult to maintain yes.
The way ItemMeta does it has proven again and again to be very flawed. 😛
Resolves https://github.com/PaperMC/Paper/issues/10159
An alternative would be to make BlockStateMeta#setBlockState nullable. I don't know if we want to make that change, especially since the interface is already setup so the getter is nonnull and there is a has boolean method.
Yeah a way to clear these values would be great as well, mentioned the default value thing since getBlockState seems to return the default state even when the item doesn't have that NBT at all, so I assume it is available somewhere - but don't know how hacky are the internals there, so if a method to clear would be better that's good as well.
Not sure how big of a PR do you want to make this, but as mentioned in the original issue there's a few other places with a similar problem:
ArmorStandMeta's values are allboolean(i.e. can't be cleared)AxolotlBucketMeta's variant can't be clearedCompassMeta'sLodestoneTrackedis abooleanand will always remain in NBT, etc.
This API should be thread-safe as there is no world state
Reported in https://forums.papermc.io/threads/concurrentmodificationexception-on-chunkgenerator.1022/
I think ideally, the mapping between enums would be just all created during startup, and that is certainly something we could do to fix this, just this is smaller diff.
All those 3 boil down into the fundamental flaw of ItemMeta, which is why the property API is coming to be a thing
I really need this feature to run a minecraft server securely on k8s. So i'm looking forward to see the merged pullrequest. @electronicboy
Generally, I think this method needs a bit of a larger discussion, I already touched on this when this PR was proposed to paper, imo this logic barely deserves to live in the API, at best in UnsafeValues, tho that is just my opinion.
Has there been discussion about that ever since?
Having access to Bukkit's setTitle(String) via the InventoryView class and Paper's title(Component) via UnsafeValues doesn't sound like a reasonable thing to do. Both methods should be in one place....
After manually patching in the async catchops into 1.20.2, it appears to have been thito's fancywaystones plugin calling async playsound. Remedy for anyone with an identical set of circumstances should just be updating that plugin.
[15:20:47] [FWIO/ERROR]: Thread FWIO failed main thread check: play sound
java.lang.Throwable: null
at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:14) ~[paper-1.20.2.jar:git-Paper-"931781c"]
at org.bukkit.craftbukkit.v1_20_R2.CraftWorld.playSound...
[PaperMC/Paper] New branch created: contrib-guidelines
8c8862f Also check for the actual character length in R... - kennytv
Allows for easier identification of what a change is for/what patch it belongs to. Also important for future changes
Should this wording be updated to make it sound required? I think its left over from when these were optional.
Despite all issues this can cause when called on InventoryClickEvent
We don't want to add more API that is inherently broken. I'm leaning towards deprecating the setTitle(String) method with the notice that it is just broken and shouldn't be relied upon.
I wasn't aware of any desyncs and other glitches that may happen.
Yeah, they certainly exist as lynxplay pointed out. Double-clicking to collect items of the same type just doesn't work.
If we can show that cancelling + chan...
Yeah, I agree with @electronicboy here. Those point to specific properties that can be reset. The property API is the way to handle that. Other similar clear methods pertain to whole groups of data, like PotionMeta#clearCustomEffects, FireworkMeta#clearEffects, and more, all exist and I think this falls into that category.
Generally, I think this method needs a bit of a larger discussion, I already touched on this when this PR was proposed to paper, imo this logic barely deserves to live in the API, at best in UnsafeValues, tho that is just my opinion.
Has there been discussion about that ever since?
Having access to Bukkit's
setTitle(String)via theInventoryViewclass and Paper'stitle(Component)viaUnsafeValuesdoesn't sound like a reasonable thing to do. Both methods should be in ...
Decorated Pot calls EntityChangeBlockEvent, which feels good.
The behavior of the Decorated Pot and the Chorus Flower is indeed somewhat similar.
But I don't know when the upstream will be able to add it.
Maybe paper can do that.
TODO:
- [ ] cleanup diff -> formatting is messed
- [ ] tbd.
I think we need to decide the usefulness of this event. I generally think that this doesn’t have much use, as most server owners will not give players access to fill / setblock due to not only how primitive it is.. but also like it’s not as performant as what world edit and such may offer.
My reason for thinking this is a good thing to have, is it allows client-side mods to take advantage of the vanilla commands for pasting schematics and such.
Need to clone as its mutable
My reason for thinking this is a good thing to have, is it allows client-side mods to take advantage of the vanilla commands for pasting schematics and such.
Schematic paster mods typically already have this logic for by placing blocks, which is now gonna be easier with the block interaction attribute.
Just donno, I seriously do not know servers that would even use setblock/fill over FAWE, which has been the standard in general for stuff like this.
Schematic paster mods typically already have this logic for by placing blocks, which is now gonna be easier with the block interaction attribute.
They didn't yesterday in chat when someone was asking about this for Litematica support. I don't think the printer functionality is built-in anymore. Plus, printing is still different from pasting all at once.
I seriously do not know servers that would even use setblock/fill over FAWE
This doesn't replace worldedit by any means, and having one enable doesn't disable the other.
78fcb8e [ci skip] Update contributing guidelines to inc... - kennytv
[PaperMC/Paper] branch deleted: contrib-guidelines
2faf6d7 temporary, remove this and replace later - Machine-Maker
[PaperMC/Paper] New branch created: update-upstream
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
63c208dd Remove no longer used import
70be76c7 PR-958: Further clarify deprecation of TAG_CONTAINER_ARRAY
ae21f4ac PR-955: Add methods to place structures with block/entity transformers
e3d960f2 SPIGOT-7547: Remark that Damageable#setAbsorptionAmount() is capped to a specific value
b125516c Fix typo in R...
8657cd9 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#... - Machine-Maker
[PaperMC/Paper] branch deleted: update-upstream
Expected behavior
I can change the player's name during AsyncPlayerPreLoginEvent by using setPlayerProfile(Server#createProfileExact(uniqueId, name))
Observed/Actual behavior
I can't change the player's name, he connects to the server with the initial name anyway,
Steps/models to reproduce
@EventHandler(priority = EventPriority.LOWEST)
public void handleEvent(AsyncPlayerPreLoginEvent theEvent) {
theEvent.setPlayerProfile(Bukkit.createProfileExact(UUID.randomUU...
Does the int represent a RGB or RGBA color value or is it just a index for an enum Color?
Please either clarify in JavaDoc or return a @Nullable Color instead.
Yeah it should be a Color object, not the raw int
Please squash commits in each submodule and rebuildPatches.
Whoops, didn't notice it made a new patch, fixed
[PaperMC/Paper] New branch created: a
f9fdedf [ci skip] Add more patch identifying comments, ... - kennytv
[PaperMC/Paper] branch deleted: a
[PaperMC/Paper] branch deleted: up
This pull request exposes the getBaseSeedId methods from crop blocks.
This makes it possible to get the corresponding seed to its block representation.
E.g. Material.POTATO for minecraft:potatoes
I don't know about the name getBaseSeedId. I named it like that cause its the same as the name from the server. Maybe there is a better name for it tho.
- Integrate wiggling mechanism for rejected patches
- Version 2.0 release for optimized Git patch application
Is your feature request related to a problem?
If a plugin adds an entity as a passenger to a player and then a plugin tries to run Player#teleport (with no TeleportFlags) the player is not teleported and the PlayerTeleportEvent is not called.
The context of my issue is that I have chat bubbles which use Text Display packets to show player's messages above their heads - however due to the issue they are unable to teleport until the chat bubbles disappear automatically.
Describ...
I'm not a fan of this. This type of API should wait until Material is split up into ItemType and BlockType, and then a subtype of BlockType can be made for CropBlockType that has such a method.
Putting it on BlockData just seems like a hack to work around that. No nms BlockState or API BLockData is required to make the mapping.
Please do not open any more spam PRs, we will have to ban you from the GitHub organization if you open a 5th. If you're unsure whether a PR would be considered spam, you should discuss your planned changes in the #paper-dev channel of the Paper discord first.
see #10150, #10155, #10156, https://github.com/PaperMC/Paper/pull/10156#issuecomment-1886207648
I mean I totally agree with you on that. I didn't like putting it on BlockData either but the CraftCropBlock extends it so it just made sense as it was the easiest way to do it.
@emilyy-dev Tried bundler jar but no luck.
the bundler jar won't change anything, the bootstrappers do not pass in the full classloaders as those java APIs expect
@electronicboy Then why not?
Because that is how mojang designed it and how it's worked for years now afaik
Are you planning on addressing the comments ? Otherwise I can look into taking over the PR and completing it for you.
Sorry forgot about this, I can implement the requested changes but i'm unsure of how to merge this into the Add-new-overload-to-PersistentDataContainer path so if you want to take over the PR that's fine
but i'm unsure of how to merge this into the Add-new-overload-to-PersistentDataContainer patch
You can look at the CONTRIBUTING.md file for that. It explains it really nice how to edit existing patches.
We don't want to add more API that is inherently broken. I'm leaning towards deprecating the setTitle(String) method with the notice that it is just broken and shouldn't be relied upon.
I mean, I understand that reliability of this method is questionable, is there anything that can be done on the server-side to fix it?
Also wouldn't call these methods "broken" - they do serve a purpose and can occasionally break when used in the wrong place, or at the wrong time. This applies to numbe...
is there anything that can be done on the server-side to fix it?
I don't know, and I don't really care to try and hack a solution in to fix some of the issues. The game's protocol just flat out doesn't support changing titles without re-creating and re-sending the entire inventory open packet which makes the client create a whole new screen and change to it.
Based on my quick understanding of how double-click works, it is tracked on the client, and if the current screen sees 2 clicks ...
I would remove the nms name and apinote comment from the fields. I agree that the nms one isn't really needed there and the apinote I think is just better off only at the top of the class, so that it is easier to browse downloaded API source in IJ as a user
A lot in the generator can be re-used for similar ones in the future, but abstracting those parts out is better done later. just so that's on the radar
I've been trying to fix world save lag spikes for a month. This patch fixed the issue, thanks
still missing the local variable name 💩
- Refactored the GitHub pull request orchestration script.
- Improved remote repository interaction
- Enhanced branch cleanup by automatically deleting temporary branches and upstream references.
reformatting is not an optimisation, and after the repeated spam PRs, we have decided to ban you from the organisation
Expected behavior
Setting hopper-amount to 10 makes the Composter added 10 times, or 20, or 30, etc.
Observed/Actual behavior
It just adds by 1 like regular players.
Steps/models to reproduce
Modify spigot.yml config, set hopper-amount to 10.
Plugin and Datapack List
None.
Paper version
Current: git-Purpur-2124 (MC: 1.20.4)*
Previous: git-Purpur-2120 (MC: 1.20.4)
- You are running the latest version
Other
For the life of me I could not find a way to report...
this is the Paper issue tracker, reproduce the issue on Paper or report it to Purpur
Lovely PR, left a few minor additions that could make it a bit more adventure, but otherwise very nice
Might be nice to have a ComponentLike overload
Can implement ComponentLike
Can implement StyleBuilderApplicable
Why is it not possible to teleport a player that has a passenger in the first place?
I mean the only thing I can think of is because of how the passenger logic works but there has to be a better solution to this or not?
The intended solution for your case is to just use the TeleportFlag.EntityState.RETAIN_PASSENGERS flag. Why don't you want to use the specific flag for this case?
Another solution to your suggestion would be to add new flags called DISCARD_PASSENGERS, DISMOUNT_PASSENGERS etc. to teleport the player and either dismount or remove the mounted entities in general.
Missing commit description: "- Add EntityToggleSitEvent".
Also should comment follow indentation? bukkit and spigot states that they should
The intended solution for your case is to just use the
TeleportFlag.EntityState.RETAIN_PASSENGERSflag. Why don't you want to use the specific flag for this case? Another solution to your suggestion would be to add new flags calledDISCARD_PASSENGERS,DISMOUNT_PASSENGERSetc. to teleport the player and either dismount or remove the mounted entities in general.
The issue is that I have no way of guaranteeing that every other plugin is going to add the RETAIN_PASSENGERS flag.
F...
Should no longer be an issue in 1.20.4
Should no longer be an issue in 1.20.4
Missing this fix in the patch description
Yeah that's what I realised later as well.
I think a PlayerPreTeleportEvent can be useful for such cases. The next question would be what methods we expose in that event and do we already allow modification of e.g. locations. Also does it make sense to extend PlayerMoveEvent?
Potential successor of #9408
This takes the same general sense of that PR, however makes it much safer in terms of shutdowns, unloads, etc, at the cost of having a thread per world dim store. In theory, this could easily be a shared single pool thread pool, I debated on using a shared more general pool however guaranteeing the safety of writes to this would require much more diff vs what is done here.
PME assumes a movement is occuring, not that a movement will occur, so, generally, no, it should not, as otherwise plugins would be processing effectively the same general intent twice
Having a pre event was always somewhat of a consideration, a hindered event as was proposed elsewhere gets a bit weird when all of the existing API around this stuff just returns a boolean with no real pre-existing causes. This was something that was on my todo list elsewhere, I think I started something w...
A pre event would definitely work, presumably the content of the event would be mostly identical to that of the PlayerTeleportEvent?
The next question would be what methods we expose in that event and do we already allow modification of e.g. locations.
I think modifying locations here would be fine
There are reasons I can think of why the original patch was dropped:
- Mojang made some code changes in order to optimize the networking performance in 1.20.2, as some of these changes were similar to a collection of patches had already existed in Paper, resulting in the removal of these patches.
AbstractEventExecutor.LazyRunnablehad been deprecated since the release of Netty 4.1.92 (see https://github.com/netty/netty/issues/13335)
Although there is an alternative mechanism prov...
This diff is likely not needed
Actually, no, we need to at least move over to AbstractEventLoop, though, it seems that all of the event executors we'd see all implement SingleThreadEventLoop
This was something that was on my todo list elsewhere
@electronicboy are you still planning to do it or can I work on it?
it would generally be better if somebody else worked on it, my todo list is generally swamped right now
[PaperMC/Paper] New comment on pull request #10172: add back optimise non-flush packet sending patch
Has this been tested? I can't connect to the server.
[PaperMC/Paper] New comment on pull request #10172: add back optimise non-flush packet sending patch
it's a small change in which packets which need to get out fast are generally marked as such, and this is working fine here, however, I do test behind a bungee proxy
[PaperMC/Paper] New comment on pull request #10172: add back optimise non-flush packet sending patch
Has this been tested? I can't connect to the server.
Oops.
I was testing @electronicboy 's suggestion and accidentally pushed that code change as I was out of focus for a little bit.
Now this PR should work normally again just like from the beginning.
[PaperMC/Paper] New comment on pull request #10172: add back optimise non-flush packet sending patch
Has this been tested? I can't connect to the server.
Oops.
Yes this has been tested and indeed was working, but I was testing out @electronicboy 's suggestion (which causes the player cannot connect to the server) and accidentally pushed that code change as I was out of focus for a bit.
Now this PR should work fine just like from the beginning and I have to be careful next time. Thank you for catching me up!
Moving from SingleThreadEventLoop to AbstractEventLoop could cause ClassCastException to be thrown, rendering the server cannot be joined by the players.
This pull request adds a PlayerPreTeleportEvent. Resolves #10168
Currently WIP because there are some things that need to be figured out. For example where we want the event to be called in each case. It is currently called where I think it makes the most sense. If we want to call it earlier, it needs some serious refactoring at some places and sometimes it really does not make sense to call it earlier.
Also do we want to add a EntityPreTeleportEvent?
What also needs to be di...
Expected behavior
When a mob's goals are entirely removed via Bukkit.getMobGoals().removeAllGoals(entity), they should have no target or pathfinding. The mob should sit idle until acted upon by an external force such as a player.
Observed/Actual behavior
When a Guardian (or Elder Guardian) is out of water, they jump around. This happens when removeAllGoals is used on the mob. As a point of reference, this also happens when the mob is given slowness as well. The only way to prev...
Fixes the incorrect Javadoc comment of the BlockDropItemEvent as described in #10133
I'm not entirely sure if the // Paper end - Fix incorrect documentation is in the right place as it's between the Javadoc comment and the class definition.
Generally we don’t even add paper comments for Javadoc changes. Also, this change can be merged in with an existing patch called something like “fix javadocs” or “fix upstream javadocs”.
Thank you, I'll do that in the morning
Calls the EntityChangeBlockEvent for when candles, normal ones and the ones on cakes, are extinguished as described in #10112
Modifiability
I think that it doesn't needed in this event, so just call it with a cloned Locations if necessary. IMO the main purpose of this event is to "notify" plugins that a player will be teleported, and they need to prepare him for this (for example, as in my case, remove all passengers or setSpectatorTarget(null) if he is in spectator game mode).
Is your feature request related to a problem?
When the number of players reaches dozens of people, the high simulation distance cannot be afforded. My simulation distance is 5.
And then Monsters outside of simulation distance do not disappear randomly.
Peper has an option for this
Hopefully it would be nice to separate the Y-value checks separately.
For example, monsters can be configured to disappear outside of 128 from the player's Y value.The X and Z values disappear beyond 80.
(...
removing the mob goals only removes the mob goals, it does not remove any custom AI logic that entities have hardcoded on them
EntityPreTeleportEvent
The EntityPreTeleportEvent would likely be useful for the same reasons that PlayerPreTeleportEvent is useful, obviously would be even more niche scenarios but, would make sense to exist
Stack trace
[14:23:52 ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH - git-Paper-389 (MC: 1.20.4) ---
[14:23:52 ERROR]: The server has not responded for 50 seconds! Creating thread dump
[14:23:52 ERROR]: ------------------------------
[14:23:52 ERROR]: Server thread dump (Look for plugins here before reporting to Paper!):
[14:23:52 ERROR]: ------------------------------
[14:23:52 ERROR]: Current Thread: Server thread
[14:23:52 ERROR]: PID: 26 | S...
that actually fixed my problem, thank you so much!
Hopefully paper accept that pull request
Needs identifying comments, but I can do that during my routine as well
Add back Reduce allocation of Vec3D by entity tracker patch
Thank you for the PR! There's already a patch for adding tons of missing calls, please merge it into that: Fire EntityChangeBlockEvent in more places (patch number 0824 currently)
Modifiability
I think that it doesn't needed in this event, so just call it with a cloned
Locations if necessary. IMO the main purpose of this event is to "notify" plugins that a player will be teleported, and they need to prepare him for this (for example, as in my case, remove all passengers orsetSpectatorTarget(null)if he is in spectator game mode).
I agree here. This event should be solely for "preparation" purposes and to make stuff more compatible with other plugins.
In situations like this I wish there was an Immutable Location
can just always return a clone of the stored Location object
can just always return a clone of the stored Location object
Yup good idea.
Yeah, that works just thought it'd be handy for clarity
As far as I can tell, the memory that this method reserves is only ever released by the server in one spot, which is unused in paper. By not allocating it we save about 10,5 MB of memory that can then be used elsewhere
This is 100% intentional, this memory will pretty much end up in old gen and not be a real factor towards anything until you hit "oh shit", at which point, it's freed in order to pray that they can close the JVM in a safe and effective™ manner
Then again, the place its used is dumb, I'm not 100% sure on removing this, it's pretty much a pointless slab of memory in which is effectively useless, so it's not a big deal in any manner, not sure, either we remove it or we figure out a manner of effectively using it if needs be
[PaperMC/Paper] New comment on pull request #10172: add back optimise non-flush packet sending patch
This patch broke the plugin that reads and modifies chat packets with ProtocolLib.
Is your feature request related to a problem?
Right now, if you want to restrict block modifications, you need a heavy plugin like CoreProtect, etc. I would like to make a plugin that detects when a block is replaced, and stop it.
Describe the solution you'd like.
A new class called BlockModifyEvent, the event would contain a property for the block, the old state, and the new state, and a cause enum, which can be one of the following:
- Block type change
- Block property change...
Block entity data change
I'm not sure what this means. Anytime what changes on a block entity, anything that is stored in NBT? that means every single tick, it would fire for every furnace because the burn/fuel time is stored in NBT. Anything any inventory changed, including anything hopper-related. We already have intense events for those in the InventoryMoveItemEvent.
Handling every single possible event for blocks changing is extremely hard to maintain
While this might be true...
[PaperMC/Paper] New comment on pull request #10172: add back optimise non-flush packet sending patch
This patch broke the plugin that reads and modifies chat packets with ProtocolLib.
Are there any log about this?
[PaperMC/Paper] New comment on pull request #10172: add back optimise non-flush packet sending patch
This is basically down to how they hook the event loop stuff
[PaperMC/Paper] New comment on pull request #10172: add back optimise non-flush packet sending patch
It seems like I have to open a PR on ProtocolLib to make their event loop hook extending AbstractEventLoop
+public interface DecoratedPot extends TileState, BlockInventoryHolder, org.bukkit.loot.Lootable { // Paper - expose loot table
I think it might be nice to add getters for the background & highlight color to spawn egg meta, but currently also lgtm
Closing in favour of #10171 which should be getting merged soon, thank you for your contribution!
This is missing identifying patch comments but rest looks good
Indent here is a bit weird
eeb6afc [ci skip] Add more identifying patch comments, ... - kennytv
(didn't get all of this one in properly, will be fixed next commit)
Can use a start/end comment block here
Duplicate space before the comment
This can be left without indentation to reduce the diff
force inline, valid for this whole patch commit description is not consistent with above
Ok so, I am working on the changes right now and the more I am working on the EntityPreTeleportEvent the more I get the feeling that this is bigger than just a few calls.
For example, the Event initially doesn't have a TeleportCause I can use. Should I create a new Enum, do we use the PlayerEvent.Cause enum (This would not really make sense) or do we just leave it?
This should be a one line comment otherwise "// Paper end" missing
The "Paper start" comment doesn't match with this end
Missing "Event" part of the event name, it's not consistent with all your previous and later commits
The start/end part of the paper comment should be in lowercase
The EntityTeleportEvent doesn't have a TeleportCause so I don't see why EntityPreTeleportEvent should?
Or am I misunderstanding?
The paper start comment doesn't match with this end and this comment doesn't match with the commit description -> different letter case for proxy protocol
This fix was already added above with different comment tho
Duplicate // Paper comment looks weird on a single line
The following contributor: NonSwag mrminecraft00@gmail.com
has been forgotten as co-author of this patch.
[PaperMC/Paper] New branch created: a
[PaperMC/Paper] New branch created: b
[PaperMC/Paper] branch deleted: a
[PaperMC/Paper] branch deleted: b
[PaperMC/Paper] New branch created: b
[PaperMC/Paper] branch deleted: b
Ok so I started adding the EntityPreTeleportEvent. I have no clue why the workflow fails. I tried to apply patches locally and it works. Build also works.
I have searched some posts and found the problem has been persisted for a long time, as discussed in this SpigotMC post.
The anvil inventory instance created by server.createInventory is a instance of CraftInventoryCustom, which as this post states, it is not a real AnvilInventory and can not cast as well. Additionally, it does not invoke PrepareAnvilEvent.
The biggest missed function of this is ...
It would be nice if paper add a implementation for it someway. For instance, maybe opening the UI from a real anvil created internally, not present in the world?
There is a way, the openAnvil method that was mentioned above your post. You can customize the title too with the InventoryOpenEvent title override.
[PaperMC/Paper] New branch created: asyncsaveddataio
[PaperMC/Paper] branch deleted: asyncsaveddataio
What's left regarding actual implementation? It looks pretty complete
Implementations of the EntityTeleportEvent aren't fully covered yet. Minor cleanup of the Patches are also necessary. Then I would hope someone in the team could take a look if that what I have done is alright. Did change quite a bit in the CraftEventFactory class 😅.
4a98986 Add back Reduce allocation of Vec3D by entity t... - Pantera07
Yeah no, I think that this is fine to have removed. It makes sense on the client as it's used to give some wiggle room for loading world lists and such, which isn't an issue on the server.
Also see the above comment, otherwise approved
Same comment after - on the end comment
This seems redundant: optimize collection * 2
Paper start and end comments here doesn't follow the format
& would imply something before, it's not the case here or the first commit is missing
This comment is not needed, the line stays the same
[PaperMC/Paper] branch deleted: ppc64le/sqlite
[PaperMC/Paper] branch deleted: fix/clientbrand-v2
When a plugin listens to the EntityAddToWorld and EntityRemoveFromWorld events, I don't believe there is currently any method of directly obtaining which world the entity was actually added to/removed from. Using event.getEntity().getWorld() works in many cases, but not all. Specifically, when an entity is teleported from one world to another, the location of the entity is updated prior to the removal event being called. This means that when an entity goes through a nether/end portal or is ...
Please do not open pull requests from the master branch, create a new branch instead.
When a plugin listens to the EntityAddToWorld and EntityRemoveFromWorld events, I don't believe there is currently any method of directly obtaining which world the entity was actually added to/removed from. Using event.getEntity().getWorld() works in many cases, but not all. Specifically, when an entity is teleported from one world to another, the location of the entity is updated prior to the removal event being called. This means that when an entity goes through a nether/end portal or is te...
8f1e4d3 generate tags and structure type - Lulu13022002
Expected behavior
Flying Ender Pearl triggers ' EntityMoveEvent ' event
Observed/Actual behavior
The Flying Ender Pearl will not trigger the ' EntityMoveEvent ' event
Steps/models to reproduce
Create a simple plugin and listen for ' EntityMoveEvent '
in kotlin, like this :
@EventHandler
fun onPearlFly(event: EntityMoveEvent) {
if (event.entity.type != EntityType.ENDER_PEARL) return
println(event.to)
}
Then enter the game, throw the Ender Pearl...
The EntityMoveEvent will only be called for Living Entities. This is mentioned in the Javadocs for the event.
The ender pearl is not a living entity, so it won't call the EntityMoveEvent.
thanks, but is there any way to monitor the flight of the ender pearl
The paper start comment doesn't match with this end
Small typo Optmize -> Optimize, valid for this whole patch
The paper start comment doesn't match with this end
This should be a Paper end comment, not stop
This seems redundant : see "don't fire events in world generation"
The line is now commented twice and one has some formatting issue
There's no paper end comment to this start
There's no paper end comment to this start
That "Event" part was okay just need to stick to the name
This patch should be renamed since the option is gone and the doc website should be updated: https://docs.papermc.io/paper/reference/system-properties#debugentities
Rebased and cleaned up to match new guidelines.
This paper end comment doesn't have a start comment. But all this can be on a single comment on the changed line or a multi line comment inside the method.
Also this commit is kinda mangled so i'm sorry if i don't catch all the stuff you changed
Duplicate t: EntityPushedByEntityAttackEventt
Upstream has proposed https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1344/overview on upstream, it is probably best to hold out for that.
X/Y/Z Power is Acceleration, not Velocity - this PR causes fireballs to accelerate continually over time if you set the velocity
Started having this issue in 1.20, still an issue in 1.20.4
[ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD]
Always seem to hang for 5-10 min, server starts normally after.
THis issue is about a deadlock, not being stupidly slow to start, that would be a seperate issue and require more information such as profiling or at the very least a few jstack reports
Resolves https://github.com/PaperMC/Paper/issues/9484
I made the decision to not expose stuff like asCreative() and instead added a separate enum value for that.
Feel free to decide otherwise.
No need to parallelstream here, the returned value also shouldnt contain any null components
See https://github.com/PaperMC/Paper/pull/9815#discussion_r1461306045
The patch should probably be reverted and maybe a new setPower method added
Ok so i finished the initial work and this should be ready for testing and reviewing.
I think some javadocs for each of these would be warranted.
You should use CraftItemStack#unwrap here instead of copy. There is no need to copy the stack as there shouldn't be any mutation of the stack going on (I think).
Should the javadocs include a note that it might not be the same as the entity's world? or is that not worth mentioning.
I think it doesn't hurt to add it.
Expected behavior
When a block with an item frame on it is destroyed the item frame will also be destroyed. It is my understanding that this event is supposed to fire when that happens, and it does, but I expect the event.getItems() method to return an array containing the item frame that is being dropped.
Observed/Actual behavior
The event fires twice, but the event.getItems() method returns an empty array both times.
Steps/models to reproduce
- Place an item frame on a ...
Sure, it certainly doesn't hurt to clarify things. I added a note to the javadoc in the EntityRemoveFromWorld event. Though I don't believe it's necessary to note it in the EntityAddToWorld event. While I did add a getWorld() method to the EntityAddToWorld event as a precaution, this issue mainly pertains to the EntityRemoveFromWorld event, and I can't think of a scenario where the world would differ from the entity's world when the EntityAddToWorld event is being fired.
[PaperMC/Paper] New branch created: a
c57d1aa Move diffs around to compile without later ones... - kennytv
[PaperMC/Paper] branch deleted: a
Thank you @Nacioszeczek my bad
Space after <.
The rest of this method also seems to have some formatting issues (see missing space after switch statement, missing space after (...CraftPlayer) cast)
581b101 Add world to Entity AddTo/RemoveFrom Events (#1... - 1stGlitch
Paper end should be on another line
I think this should go in the paper package
24dc2bf Add BlockStateMeta#clearBlockState (#10160) - Machine-Maker
This does not handle cases where the player is null. Such as extinguishing with potions.
76da4bc Expose LootTable of DecoratedPot (#10023) - FireInstall
11645e3 [ci skip] (Mostly) finish adding identifying pa... - kennytv
Upstream now calls the entity change block event, which should suffice for protection plugins.
The issue will be closed once we updated our upstream reference.
Upstream has added related matters.
292ec79e09e3b90358560dd9e571452c9da7500f
[PaperMC/Paper] branch deleted: a
b700460 Convert average tick value in the GUI to the co... - electronicboy
Expected behavior
Flying entities calling EntityMoveEvent while flying to a destination.
Observed/Actual behavior
EntityMoveEvent was not called when a flying entity was going to a destination.
Steps/models to reproduce
// Make sure to register the listener.
@EventHandler
public void onEntityMove(EntityMoveEvent event) {
if (event.getEntity().getType() == EntityType.PARROT) {
Bukkit.broadcastMessage("Parrot moved.");
}
}
In game, spawn a...
Expected behavior
Calling an Entity's setLootTable should... well, set the loot table.
Observed/Actual behavior
I am spawning an Entity that I immediately call setLootTable(LootTables.EMPTY.getLootTable()); on. Spigot docs say I should set to null, but this doesn't seem to have any impact on the drops of the entity, while setting to empty does.
On Spigot, this works as I expect, the entities spawned do not drop anything.
On Paper, with the same configuration (theyre launch...
Interesting... yeah the issue is caused by LootTables.EMPTY#getLootTable actually returning null for empty when it shouldn't So doing LootTables.EMPTY is the same as null.
Fixes https://github.com/PaperMC/Paper/issues/10189
When the loot table registry system was changed, this wasn't update to actually check if the loot table didn't exist to return null. As a result, LootTables.EMPTY#getLootTable returned null when it shouldn't have.
[PaperMC/Paper] New branch created: a
b03f255 Finish moving patches back and improving compil... - kennytv
[PaperMC/Paper] branch deleted: a
Because this exploit has been widely known for years and has not been fixed by Mojang, we decided that it was worth allowing people to toggle it on/off due to how easy it is to make it configurable.
It should be noted that this decision does not promise all future exploits will be configurable.
paper-global.yml:
unsupported-settings:
allow-unsafe-end-portal-teleportation: true
With hard forking on the future, we are hoping to open Paper up to more groups of peop...
I believe this would be beneficial to the project, given the considerable amount of time I've spent assisting people in the Paper-help channel. It is indeed a frequently requested feature, and since @Owen1212055 has volunteered to maintain it, there should be no issue!
It would just be part of the unsupported settings, receiving similar treatment to bedrock breaking and TNT duping. 👍
Is your feature request related to a problem?
Negative. I'm just posting it here because I couldn't find the right place for it.
Describe the solution you'd like.
Not sure if this is the right channel for it, but...
Today I learned about this:
_"C++ got this nice extern C thingy that makes the compiler use C-style linkage for parts of your code.
and java has ways of calling c-style native libraries.
that's how it interacts with your operating system and other stuff"_
...
Hey, thanks for raising this!
The team is already aware of the multiple ways to call native code in java.
In general, modern java is approaching native performance, so the benefits aren't as big as they once were, so the overhead and complexity isn't worth it.
It makes much more sense to improve or replace existing java code with better java code, like the team has been doing for a decade now with great success.
Note that paper already utilizes native code for some things, in particular...
Isn't it necessary to define a vanilla-default value here (30)?
Because now, if I understood correctly, it will be 0 and this PR will prevent having arrows in body by default at all...
Same for stingers
woops forgot to set that lol
since the irc section was also removed on the website i assume it should also be removed here?
7f7d05a [ci skip] Remove IRC link from the README (#10194) - notTamion
Needs docs before merge, maybe even an announcement that we now support it
I just generally wanted to say,
A large part of the reason why the projects within this space can thrive and exist, like forge, fabric, etc; is because they rely on the Java code being decompilable and runnable in many places, the fact that we can modify mojang code (either at runtime or beforehand), effectively, is what allows these projects to add in their hook points and such to easily expose to mods, plugins, etc, to carry their goals on without impacting vanilla code too much, as, for...
If this wasn't in Unsafe, I would have some comments, but I think since it is, and therefore API compat isn't guaranteed, I think its fine.
Perhaps some more stable API can be added once we have subtypes of ItemType and BlockType in the API.
Looking at how extinguishing happens, I no longer think this event is appropriate for it. Extinguishing candles can happen due to non-entity related interactions, like water flowing. We need a solution that covers all these cases, not just some of them.
I changed it back to asNMSCopy because apparently there is some possibility of a mutation in the tooltip lines (when an exception is caught parsing the JSON for display name and lore, it removes the display name and lore).
0cc3a7e Disable memory reserve allocating (#10180) - Warriorrrr
3841722 Properly check if a loot table exists (#10190) - Machine-Maker
b3c8108 [ci skip] Fix incorrect documentation for Block... - rowan-vr
Adds Conduit API to the basically not existing one lol
Can we have diff on change stuff here? These magic numbers are scary.
what do you mean by diff? i mean thats just simple vanilla logic for conduits. for every 7 prisma blocks you get 16 blocks of range
Does not function during PlayerMoveEvent.
Caused by something clearing the supported block optional temporarily in the logic flow.
Needs further investigation before merging as onMove is a way too useful place to call this, merging this without that working is a dead end.
The behaviour here is kind of weird.
This is not really a max, barely a soft maximum.
It is a weird way to set one part of the computation algorithm used to determine the ticks till next arrow removal.
I think we'd be better off if we expose a setter for said tick time till next removal.
Plugins wanting to change the value for e.g. 40 arrows can do that in the removal event by setting said value to e.g. always 20 ticks or 1 second.
Or compute their own logic.
We'd need to look into ...
yeah thats probably a better way to do it. what would be a good name for the setters? something like setTicksUntilNextArrowRemoved?
Needs consideration for
a) CREATIVE and CREATIVE_ADV only apply to inside the creative inventory. not normal player inventory of a player that is in creative.
b) no creative category nor tags are rendered.pain
c) "unify that advanced is kinda
Scratch that ---
computeTooltipLines(Player, TooltipFlag...)
with Flags CREATIVE and ADVANCE.
Callers may pass none, one or both to combine the two.
Needs consideration for
a) CREATIVE and CREATIVE_ADV only apply to inside the creative inventory. not normal player inventory of a player that is in creative.
b) no creative category nor tags are rendered.pain
c) "unify that advanced is kinda
Scratch that ---
computeTooltipLines(Player, TooltipFlag...)
with Flags CREATIVE and ADVANCE.
Callers may pass none, one or both to combine the two.
Needs diff on change e.g.
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
index 963a59615..4f31dfa64 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
@@ -191,7 +191,7 @@ public class ConduitBlockEntity extends BlockEntity {
priva...
Maybe a blockextinguishevent and a playerblockextinguish event? Both events could extend some event to be able to listen to it
On Jan 27, 2024 at 7:28 PM, <Jake Potrebic @.***)> wrote:
@Machine-Maker requested changes on this pull request.
Looking at how extinguishing happens, I no longer think this event is appropriate for it. Extinguishing candles can happen due to no...
I ported that patch to my Folia fork and the total throughput of clientbound packets on 4 Netty threads increased from about 120k to about 500k per second.
io_uring is definitely worth implementing in Paper & Velocity. 👍
Is your feature request related to a problem?
Custom tipped arrows have this annoying issue where they show the incorrect potion durations in the lore. The shown duration is the actual duration divided by 8. This is likely because a developer did the math to divide a potion duration by 8 when made into a tipped arrow for the lore, even though the supplied duration for a custom arrow is not actually divided.
Describe the solution you'd like.
Make tipped arrows show the correct durat...
The client is responsible for rendering the tooltip lines, so it's up to Mojang to fix the issue. There's already an open issue for this our their tracker https://bugs.mojang.com/browse/MC-98310.
Mhm I know about that issue, but I didn't realize it was client side. What if the server sent an "incorrect" value which is 8x the actual value? Since the duration displayed by the client has to be calculated from a value from the server.
then you screw up creative mode
Custom potion tipped arrows have a unique nbt tag though. which could be detected.
We are not manging the data sent to the client because then we effectively need to mess around to demangle it when the client sends it back to us, it's an entire rabbit hole which is not worth the effort for a visual issue
I see, thanks for the response.
Ofc throughput is going to increase if you disable compression as well (at the cost of clients and your networking bill), but another problem is that io uring is that, in a funny twist, many big companies have completely blocked io_uring due to being prone to tons of security vulnerabilities
Alright the method naming might need some changes but i think the current adventure style naming doesn't sound too bad.
Gone for the Adventure style or similar way. Hopefully that's what you meant @lynxplay.
JavaDoc is missing now, will add it later. Brainstorming welcome.
Sus stew.
Normal, Normal Advanced, Creative, Creative Advanced.
<img width="670" alt="Bildschirmfoto 2024-01-28 um 16 26 14" src="https://github.com/PaperMC/Paper/assets/1420893/aee53ca9-d6ab-42e8-9145-9d5385938ead">
@EventHandler
public void onPlayerInteract(PlayerInteractEvent interactEvent) {
if (intera...
Compression had nothing to do with it. My tests were with compression disabled for epool.
This PR adds a ifOnline method to OfflinePlayer. I think its self-explanatory what it does.
Stack trace
https://paste.gg/p/anonymous/d5696a39d2414aba8e70d8b8058fd81c
Plugin and Datapack List
[14:25:12 INFO]: Server Plugins (7):
[14:25:12 INFO]: Bukkit Plugins:
[14:25:12 INFO]: - BlueMap, Essentials, EssentialsChat, FarmingUpgrade, mcMMO, RHLeafDecay, WorldEdit
[14:33:13 INFO]: There are 2 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)]
[14:33:13 INFO]: There are no more data packs available
**NOTE - Crash still occurs with all plugi...
We could save some resource by caching getPlayer into a variable as isOnline invokes getPlayer and performs a not-null condition.
Player player = this.getPlayer();
if (player != null) {
consumer.accept(player);
}
and do the same in CraftPlayer
This does not really seem to be useful when you can just do
OfflinePlayer op = ...
if (op.getPlayer() instanceof Player player) {
// ...
}
at best you will save one line for one line, every other case isn't really excusable
Maybe using isConnected instead of isOnline will be better? But then I think you'll have to rename the method to ifConnected... Or, just add both methods...
This does not really seem to provide much value when you can just do
OfflinePlayer op = ... if (op.getPlayer() instanceof Player player) { // ... }at best you will save one line for one line, every other case isn't really excusable
I mean I think that is the nature of if<insert> methods. See Optional#ifPresent for example and people still use it.
I mean I think that is the nature of if methods. See
Optional#ifPresentfor example and people still use it.
Optional's whole purpose is being potentially present, though. It can't be cast from Optional to Definitely
This does not really seem to provide much value when you can just do
OfflinePlayer op = ... if (op.getPlayer() instanceof Player player) { // ... }at best you will save one line for one line, every other case isn't really excusable
I mean I think that is the nature of if methods. See
Optional#ifPresentfor example and people still use it.
I don't see how it makes sense to compare OfflinePlayer with Optional, one is mean...
I must admit that I did not have your way in mind for that case. But I don't think that this method is useless at all either and certainly not redundant.
You said that this would save one line but especially if my code just needs one line its super handy to have such a method.
For example you generally work with OfflinePlayer and write a friend system and someone sends a friend invite it looks better (my opinion) if you use
OfflinePlayer op = ....
op.ifOnline(player ->...
it's yet another patch that we have to maintain when we've already got far too many patches for githubs folder to manage, which adds very little other than saving an line or two in code, with a method which extends the usage of an API method which quite frankly the implementation of sucks and probably should not be expanded too much further
I get the second part of your message, but I don't understand the first part. As far as I know, once the repo restructure happens there will be a patch per class, so it won't be another patch and you might also have too many patches (I don't know how many classes Paper modifies) for github and since I don't add a new class i also won't add a new patch. But starting to argue with the fact that "githubs folder can't manage it" or "the maintenance effort of the patch", really?
But as I alrea...
Yes, really. We use GitHub and manage the project on GitHub, the fact that we cannot even view the patches folder is a pretty hefty deal, and until we hard fork, that is going to be an annoying problem to contend with. With the new layout, patches will be organized into a folder tree, so that we don't have over 1000 patches in a folder, and then we'll be able to manage it.
In that time, either patches should be merged into other patches, or they need to further justify their worth to the p...
Not to be rude or something but I feel like this is a "I just want to contribute something" kind of deal. Is getting rid of like two lines of code worth the maintenance?
I also don't think it's worth adding something like this since as previously mentioned you can already write code that only executes if the player is online.
But, the decision is not up to me, and again, I am sorry if I came along rude with this first sentence.
This is getting a bit out of hand, so here's some closing words: As emily said, the benefit to this is relatively small. Patch formats aside, adding such helper methods to API for saving the braces and line breaks of an if statement in fairly niche use-cases isn't worth adding another method you have to scroll through. Appreciate the thought anyways
Not to be rude or something but I feel like this is a "I just want to contribute something" kind of deal.
No. It is not just a "I just want to contribute something" case. I have already said above that I just wasn't aware of the instance of check and later I expanded my argumentation with a use case. I already admitted that, if you don't want to expand this particular API because its implementation sucks, is another good reason.
isOnline does not promise that a player is actually c...
Не работает жирный цвет, почините пж
Tracks the player who blew up a bed/respawn anchor so PlayerDeathEvent can be used to get the player who caused the death from the explosion.
Please do not open pull requests from the master branch, create a new branch instead.
Tracks the player who blew up a bed/respawn anchor so PlayerDeathEvent can be used to get the player who caused the death from the explosion.
Maybe a suggestion for improvement: how about adding the "igniter" into BlockExplodeEvent as well?
This pr currently breaks BlockExplodeEvent since it only gets called when the entity in the explosion is null, I'll fix this soon.
This pr currently breaks BlockExplodeEvent since it only gets called when the entity in the explosion is null, I'll fix this soon.
Are you sure? I did not look too much into the code, but aren't you mixing up the entity that exploded with the entity that caused the entity/block to explode? I think the one you have added is in the DamageSource...
This pr currently breaks BlockExplodeEvent since it only gets called when the entity in the explosion is null, I'll fix this soon.
Are you sure? I did not look too much into the code, but aren't you mixing up the entity that exploded with the entity that caused the entity/block to explode? I think the one you have added is in the DamageSource...
No, prior to the commit I just made, to differentiate whether to call an EntityExplodeEvent or BlockExplodeEvent, Explosion.java would ...
This pr currently breaks BlockExplodeEvent since it only gets called when the entity in the explosion is null, I'll fix this soon.
Are you sure? I did not look too much into the code, but aren't you mixing up the entity that exploded with the entity that caused the entity/block to explode? I think the one you have added is in the DamageSource...
No, prior to the commit I just made, to differentiate whether to call an EntityExplodeEvent or BlockExplodeEvent, Explo...
// Paper - add player kill credit
// Paper - add player kill credit
Currently testing everything to make sure I can't find anything broken
[PaperMC/Paper] Pull request review submitted: #10200 Add player kill credit to beds/respawn anchors
:tada: Welcome to paper, thank you for your first PR!
I have yet had time to test this or go through the rest of the affected code, but I added some general questions that popped into my mind on the first read-through.
The diff you need in Explosion is kind of ugly, depending on your answers to the questions we might have to look for a better way to implement this.
Manually checking for the damage source being bad_respawn_point seems not too future proof.
What is the benefit of passing the player as the source here ?
You are already forwarding the "causing" player via the damage source.
Setting the source for the explosion to not null is what is responsible for the pretty ugly checks you have to do in Explosion now.
I am unsure how happy I am with hijacking this field.
Given neither paper nor spigot have a damage source API yet it might be fine, but this is changing vanilla behaviour and spigot behaviour.
Does anything stop us from going down the same path as the critical damage API and add a field + getter/setter for the "igniter" entity ref ?
Expected behavior
Moving minecart:
Using /execute at run tp ~10 ~ ~ with a moving minecart should quickly move it 10 blocks east, before it would continue to move like normal (works with normal vanilla Minecraft)
Falling creeper:
Executing /execute at run tp ~ ~ ~ on a creeper that is falling from the sky should leave it falling like nothing happened, because it doesn't modify the creepers position at all (also works fine with vanilla Minecraft)
Observed/Actual behavior...
You're right, I totally glossed over this when I was writing it, I'll fix it in my next commit and just pass the entity through the DamageSource.
I think it makes more sense to just add a setter for the causingEntity field, since this is already used in LivingEntity's hurt method to determine kill credit, I can verify that this works later.
I was more referring to the fact that other things might use the causingEntity field.
Changing that might break things we are not aware of and testing that everything still works fine is kind of hard.
it's more the fact that "causingEntity" generally has a very explict meaning within the servers code and reusing this field is likely to cause some issues, if not now, maybe in the future; would much rather just add a field this rather than trying to hijack th emeaning of an exisitng one
This is a small cleanup of the events (mostly paper ones) with some redundant stuff that comes often when reviewing event pr (like annotating the constructor as Internal, formatting etc.). The server changes is just an update to use the right methods that probably didn't exists yet at the time the event was made and some other minor things.
Adding the same field or class name that is already linked is redundant and means they can become wrong if the reference itself is renamed
Moving non-final fields below final fields isn't necessarily a 'standard' convention, but still a nice one to keep here
I feel like the handlers should instead all be made lowercase to follow java conventions, since the list object is not constant
... I also stopped looking after API patch 260 because my browser can't handle opening more lol
Move this to the bottom of the fields
Explicit name of the event is not needed in both
This fix an issue where getHitBlock, getHitEntity and getHitBlockFace are always null for this event unlike its parent.
Wouldn't this just require more changes to hurt() in LivingEntity? It seems like all the existing logic in there would just have to be implemented twice, since the entity "causing" the event is still the person who ignited the block. I know that this avoids having unintended side effects with other parts of the code but I don't see a way it could be implemented cleanly without just mostly duplicating the logic.
This should stay, in case the variable is ever used again below later
Well that is exactly the point tho.
Vanilla does not consider the "igniting entity" the causing entity of the damage.
This PR should not change this. The logic in LivingEntity#hurt acts on the causingEntity of the damage source, which should remain null for explosions from e.g. respawn anchors.
You are merely supposed to hijack the DamageSource to pass through the entity that ignited the block so that the API event can expose it.
Changing what vanilla considers the actual causingEn...
I see how I was misunderstanding, it's definitely better for plugin developers to implement this themselves, sorry for the confusion. I'm starting to think this change would be better to make upstream, so I might create a similar pr to spigot that only changes the API. I'll close this pr and will come back to it if I run into problems with spigot.
a9b0126 Split up context preparation and actual file lo... - kennytv
[PaperMC/Paper] New branch created: pp
The function that checks wich blocks should be included in a collision has a special case with blocks that have a "Block" Shape.
If it is a Block, the check wether the block should be included in the collision does not subtract a collision-Epsilon from the bounding box
The Optimized Implementation of paper did not have this special case, wich intruduced non-vanilla behaviour
This PR fixes https://github.com/PaperMC/Paper/issues/9807
Please do not open pull requests from the master branch, create a new branch instead.
The function that checks wich blocks should be included in a collision has a special case with blocks that have a "Block" Shape.
If it is a Block, the check wether the block should be included in the collision does not subtract a collision-Epsilon from the bounding box
The Optimized Implementation of paper did not have this special case, wich intruduced non-vanilla behaviour
This PR fixes https://github.com/PaperMC/Paper/issues/9807
The code that Vanilla uses is likely a poor copy of optimisations Paper previously had years ago. The problem with this code is that Vanilla is not adhering to the collision system's principles, as the epsilon exists to fix collision bugs. The collision patch also fixes issues with the epsilon in hard entity collisions (i.e boats) as well, which are not going to be reverted.
Really, this should be reported to Mojang.
The PR changes the code that is responsible for checking wich blocks to collide with, not collision itself
This is only an problem on Paper currently, and causes noticable non vanilla behaviours as shown in the confirmed issue (https://streamable.com/dibq02)
the collision without epsilon is only used on Blocks with a "Block" Shapes, and would not revert any other collision that follows the epsilon rule
Expected behavior
After updating to Paper 405, all bold fonts are displayed by default (thin).
Observed/Actual behavior
.
Steps/models to reproduce
.
Plugin and Datapack List
.
Paper version
paper-1.20.4-405.jar
Other
No response
Does anyone have an update for this issue?
Expected behavior
I’m writing a plugin for a functional block with an inventory and I’ve encountered a problem that when you hold down the mouse button on a slot, move it to another slot or behind the inventory, the click is simply not registered. This is not a visual bug and it works with any inventory
Observed/Actual behavior
There is a showcase of problem: (https://youtu.be/SQjU9whcCIo)
Steps/models to reproduce
- Take item to cursor
- Hold down mouse button on slot
3....
[PaperMC/Paper] New comment on issue #10208: InventoryClickEvent is not fired if you hold down click
InventoryDragEvent might help you, but other than that I am afraid, it won't be possible, as those are still inventories, and being used as menus was not the original intention of Mojang....
Is your feature request related to a problem?
I was working on a plugin that requires me to listen to when an entity moves and I tested to see if it worked when a player rides it and it didn't fire the EntityMoveEvent for some reason
Describe the solution you'd like.
I would like it to fire the EntityMoveEvent when riding an entity like a pig
Describe alternatives you've considered.
It is possible to listen to the PlayerMoveEvent and check if they are riding the entity but it...
Hello,
Still nobody found a way to improve that ? Or it was just forgotten
On some servers, players just leash animals to fence to reproduce them easily, and this cause some performances issues compared to non leashed animals :/
Stack trace
It is too long that github not allowed me to submit. so i upload the crash log file.
Uploading hs_err_pid8459.log…
Plugin and Datapack List
None datapacks either plugins. Original Paper Server.
Actions to reproduce (if known)
I just download the lastest paper server (1.20.4) jar to my mac. I try to run it on my computer's java environment. After loading Spark (known from the server log), the app just crash and output the jvm crash log.
It seems to some nat...
sorry that just something wrong made by myself.
i apologize for this.
It's a low priority issue and all the sparks have expired
I'd just make this nullable in the patch the method is added to avoid diff over diff
[PaperMC/Paper] Issue opened: #10211 Reference `InventoryDragEvent` in `InventoryClickEvent` javadoc
Is your feature request related to a problem?
There's no info in InventoryClickEvent javadoc about InventoryDragEvent being called instead when player clicks and drags their cursor. Many developers with no experience with inventory API just don't know this behavior and there's no info about it in the documentation.
Describe the solution you'd like.
Reference InventoryDragEvent in InventoryClickEvent javadoc mentioning the behavior. The @see tag would also be appreciated.
...
The EntityMoveEvent fires when an entity that the server controls moves. Its called inside the aiStep() method. As soon as you mount an entity, that entity is no longer controlled by the server but instead completely under the control of the client and the server only validates that movement. The entity basically becomes a "player" as far as the server is concerned.
So while this behaviour might be a bit confusing at first, it is working as expected. I don't think additionally calling a...
Adds Event to detect Presses and Releases of Buttons&Pressure Plates.
I know button press can be detected via InteractEvents, but my main motivation was the Release part, which does not have any event. So if you deem it to be too much, I can rework it into something like BlockReleasedEvent or BlockRevertedToDefaultEvent...
Not really commenting on the merits of this event, but you can check for the pressing and releasing of pressure plates and buttons using BlockRedstoneEvent, can't you?
Not really commenting on the merits of this event, but you can check for the pressing and releasing of pressure plates and buttons using
BlockRedstoneEvent, can't you?
Yes, you can... Again, the pressing Part is there for sole parity/symmetry of the event... also as opposed to BlockRedstoneEvent, which is called for dozens other cases, this is only for the presses...
Yeah, this is probably a good thing to do. Especially since craftbukkit breaks the drag behavior making the drag event fire if you move your mouse even one pixel between mousedown and mouseup.
Expected behavior
No error, it's just a hidden system file.
Observed/Actual behavior
On server start this error is shown:
Loading libraries, please wait...
[22:29:03 ERROR]: [EntrypointUtil] Directory 'plugins/.DS_Store' is not a jar file, cannot load a plugin from it!
java.lang.IllegalArgumentException: Directory 'plugins/.DS_Store' is not a jar file, cannot load a plugin from it!
at io.papermc.paper.plugin.provider.source.FileProviderSource.prepareContext(FileProvider...
This is already fixed in build 407
From what I can tell, this issue was caused by patch 0430. Not sure if there was a specific reason behind this, as it seems the patch is deliberately resetting entity velocity. I'd be happy to fix this if it needs to be undone.
Stack trace
[17:32:56] [ServerMain/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[17:32:58] [ServerMain/WARN]: Failed to load datapacks, can't proceed with server load. You can either fix your datapacks or reset to vanilla with --safeMode
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Overworld se...
Unsupported version, and this is generally an issue down to incompatible datapacks
Unsupported version, and this is generally an issue down to incompatible datapacks
And why did work before?
You would need to work out what is wrong, vanilla generally doesn't make diagnosing this easy, nor is this the place for support
You would need to work out what is wrong, vanilla generally doesn't make diagnosing this easy, nor is this the place for support
Thanks for nothing
You would need to work out what is wrong, vanilla generally doesn't make diagnosing this easy, nor is this the place for support
What do you even by "nor is this the place for support" ??
This is an issue tracker, for reporting issues with supported versions of the software. Not for support, as there are better avenues for that for supported versions of the software which don't flood everybodies emails needlessly, i.e. discord/the forums.
I could implement another method to teleport entities with their velocity via a plugin, but because it differs from vanilla gameplay behavior, I'd suggest to fix it... I mean it's a bug, so...
No idea why that was even changed
Adds API to get if an entity is pickable, as well as its pick radius.
No idea why that was even changed
Just as a note why this was added: https://github.com/PaperMC/Paper/pull/4210
I seem to be having a similar issue where this event doesn't get triggered when fireballs explode that are spawned using player.launchProjectile, could it be the same issue?
Something messed with git seems like you merged two branches from two different pr
Having this on a Entity interface feels wrong. player.getPickRadius() will confuse many people into thinking it's a radius of player ability to pickup items. Also, Item already has canMobPickup() and canPlayerPickup() methods, so a having third one with such unclear naming will mess stuff up.
I'd say this better to be abstracted as an interface with getPickupRadius() method (also maybe getItemStack()?), and make related Entity interfaces extend it (I guess it's just Item ...
I'm a bit confused? This doesn't related to picking up items/arrows - it's related to 'picking' mobs, such as when you middle click to obtain a spawn egg, or attack an entity.
I'd say this better to be abstracted as an interface with getPickupRadius() method (also maybe getItemStack()?), and make related Entity interfaces extend it (I guess it's just Item and AbstractArrow right now).
I'm a bit confused? This doesn't related to picking up items/arrows - it's related to 'picking' entities, such as when you middle click to obtain a spawn egg or attack an entity.
Should this be mentioned in the JavaDocs then? I actually don't know if it should, all I can...
The mojang issue has been closed as "Works As Intended" so I think that they have taken a stance at this point. It would be super great to re-visit this now, and ideally simulate the rest of these events on the entity.
I'm a bit confused? This doesn't related to picking up items/arrows - it's related to 'picking' entities, such as when you middle click to obtain a spawn egg or attack an entity.
Oh, sorry, I don't really know the internals. But honestly, then it sounds even more confusing. Even though NMS uses "pick", I think there should be a better term/wording for this, and javadocs are clearly.. unclear of what exactly the parameter is.
Attempted to clarify the javadocs a bit more.
Two methods returning locales are annotated @NotNull, despite being able to return null
Why don't you use requireNonNullElse here like at the other spots?
Is there a reason why the default fallback is the US locale? I'd say if player's locale cannot be parsed, it'd better be something like Locale.ROOT, so we can check for that and act accordingly, like warning a player.
Is there a reason why the default fallback is the US locale? I'd say if player's locale cannot be parsed, it'd better be something like
Locale.ROOT, so we can check for that and act accordingly, like warning a player.
Personally, I would say it is very standard to default to English. I am biased, but defaulting to the server's root Locale seems like it could cause issues
Personally, I would say it is very standard to default to English. I am biased, but defaulting to the server's root Locale seems like it could cause issues
Well, there's also Locale.ENGLISH which is used fairly often too, hence the question. Also, the root locale isn't "server's root locale", but rather a neutral one, as stated in its javadoc.
I find requireNonNullElse to be rather unwieldy. It was used at the other location because otherwise 200+ patches would have their line numbers changed.
If the maintainers would prefer
this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(locale), java.util.Locale.US);
here then I'll make that change
Is there a reason why the default fallback is the US locale? I'd say if player's locale cannot be parsed, it'd better be something like
Locale.ROOT, so we can check for that and act accordingly, like warning a player.
Locale.US is the fallback locale used elsewhere:
https://github.com/PaperMC/Paper/blob/c5d168cef92148a6799141832fdb5f95732c1a38/patches/server/0010-Adventure.patch#L2763
https://github.com/PaperMC/Paper/blob/c5d168cef92148a6799141832fdb5f95732c1a38/patches/server/0010-A...
It's just weird in terms of consistency.
Please do not open pull requests from the master branch, create a new branch instead.
This is not a proper fix for this. This is an issue with relative teleporting which will need to be looked at, avoiding relative teleportation completely is not the solution.
I think you mean 408, but yes, it's fixed on 408.
Any idea when this will be merged? I'm relying on it for a project so if there is anything I could do to make it go faster please let me know.
Expected behavior
Ignoring it?
Observed/Actual behavior
Paper is crashing if Mojang has an active fail2ban on the server because of dossing attacks
It needs one player with a Chatmod and active Playerheads in it, textures can't loaded and the server is dead
Steps/models to reproduce
Don't know
Plugin and Datapack List
https://www.curseforge.com/minecraft/mc-mods/chat-heads
I think
Paper version
Latest
Other
Sorry no Log, because I get dossed for a full w...
If you're afraid of sharing the entire log, can you just provide the crash report file?
User declined to provide more information when asked on Discord. Closing issue for now. Will re-open if we have more information to diagnose/troubleshoot the problem.
Expected behavior
paper-1.20.4-407
Observed/Actual behavior
paper-1.20.4-408
Steps/models to reproduce
Use the latest build and then enable the GUI interface
Plugin and Datapack List
It shouldn't be necessary. The server does not ...
This is the server package I used for testing
https://1drv.ms/u/s!Aijj86QxAei8zgqLoNG_gmxoCBDB?e=B2cnc6
This problem doesn't seem to happen necessarily, I also tested both versions back and forth several times before I had the problem
What a strange mistake
Here are the logs
[logs.zip](https://github.com/P...
I've not been able to reproduce this myself either (see below) after trying multiple times on both versions. I'll close this for now but please reopen it if you can provide more information or steps to reproduce the issue!
Build 407:
Build 408:
Is your feature request related to a problem?
Display entities tick, but this is unnecessary unless you need them as passengers.
Describe the solution you'd like.
Separate options to disable ticking all four display entities (Display, TextDisplay, BlockDisplay and ItemDisplay) - and, if possible, interaction entities as well.
Describe alternatives you've considered.
I don't believe there are any.
Other
Someone proposed this on the Paper Discord last March, but I d...
I can't really think of a scenario where you would have enough display entities for this to become relevant where you also don't require their passenger/vehicle ticking functionality
Custom crops, furniture, etc are our current use-cases. We are not using the display entities as passengers, nor do they have passengers.
Expected behavior
The mentioned error should not occur.
Observed/Actual behavior
I got the following Exception on my Server:
[01:13:16] [Server thread/ERROR]: Entity threw exception at world:-804.5000776586575,46.9375,-232.63654721077813
java.util.ConcurrentModificationException: null
at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:756) ~[?:?]
at java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:778) ~[?:?]
at net.mi...
Unsupported version of paper, and stuff like this is generally down to things messing with entities improperly
Hello,
Has anyone had a chance to look into this? This is still an issue as of Paper Build 409. I've since tested running our world with a vanilla server and so far it hasn't crashed.
Thanks.
I've so far been completely unable to reproduce this. I suspect it only happens with specific config settings or only in certain worlds for some reason.
Could you share your configuration files (Bukkit, Spigot, Paper world and global config) in a paste link too? Does it only happen with specific players or in specific locations?
We need something to narrow it down a bit - if we can't reproduce the issue, we can't really fix it.
We should properly detect server JARs that have been put in the plugins folder and ignore loading + warn that they are there.
Expected behavior
When you die in vanilla, with immediate respawn enabled, you die, and instantly (or semi-instantly) respawn.
Observed/Actual behavior
In my experience, you kinda fall through the floor for a few seconds prior to respawning.
Steps/models to reproduce
Literally just enable immediate respawn, and die, i used fall damage, but /kill works as well.
Plugin and Datapack List
ViaBackwards, ViaVersion, WorldEdit
There are 2 data pack(s) enabled: [vanilla (bui...
I think it would be generally a good idea to retry it with a clean server on the latest version :)
If the issue still persists the team can work from there. Else it's most likely a via thing.
Thanks for you response! Sure thing, below are paste links for both global and world configs.
There are 5 of us that play on the server and the crashes occur when any one or number of us are logged in. Doesn't seem to happen in specific locations in our world. It's crashed when we've been in various places in the Overworld and other dimensions.
Global Config
https://paste.gg/p/anonymous/f8c4703f2aef43ea91a92aafcf12380e
World Config
`https://paste.gg/p/anonymous/c3d5fbe9ac89475b8...
do you happen to have a profiler report?
Can't really reproduce this, likely just a case of chunks needing to load for a second for your server. If you were playing on 1.20.1 you should also put that as the version and not the latest one, as there are differences that would affect what you're describing between these versions.
getRichMessage as a name for the method, based on internal discussions and the existence of the sendRichMessage method.
We should probably allow the ability to pass custom MiniMessage instances for this for custom tags and whatnot.
What would be a good way to do this? My first thought was to look at the JAR manifest, but I don't know if that's the best strategy.
The vanilla server jar & paper bundler/paperclip both have a version.json file at the root of the jar. NeoForge & Fabric installers won't have those but not sure if that's in scope of the issue anyways.
That makes sense, but any thoughts on bukkit or spigot server jars?
Why not just load only jars that contain (paper-)plugin.yml file?
Paper already does that by default. However, there is no system to detect server jars in specific
We should probably allow the ability to pass custom MiniMessage instances for this for custom tags and whatnot.
Having an option to pass custom ComponentSerializer in general would be helpful too.
As a side note, this will currently throw an exception if a user uses § in their string. I'm just thinking that there should be some safe railings for this case (like returning a def/null component), or at least some javadoc info mentioning the behavior.