#paper

1 messages ยท Page 2 of 1

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

This adds a method called isConnected to the OfflinePlayer which allows for beter checking if an instance of Player is still representing an actual online player. When a player reconnects isOnline on the old instance will still return true, but isConnected returns false. This way you can distinguish stale Player instances so offline Player instances.

More information in the comments on the paper-api patch.

rustic folioBOT
#

This introduces new methods on the PluginManager that supersede the old registerEvent/registerEvents methods. These new methods return a RegisteredListener object which can be used by plugins to better handle their registered listeners. The RegisteredListener now also has an unregster() method which can be used to directly unregister that listener from all relevant handler lists instead of having to iterate over them all.

rustic folioBOT
#

Expected behavior

Bukkit.dispatchCommand should launch a ServerCommandEvent as when typing in the console.

Observed/Actual behavior

It doesn't launch the event.

Steps/models to reproduce

Use Bukkit.dispatchCommand in a plugin and listen for the ServerCommandEvent.

Plugin and Datapack List

Server Plugins (84):
[18:26:56 INFO]: Bukkit Plugins:

  • AdvancedAchievements, AfkTitle, *AntiAFK, AntiDecoCombat, AreaShop, ArmorStandTools, ASReplace, BlockLocker, BlockVillagersEn...
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Generally a rather weird javadoc structure on the event, you are skipping the main javadoc comments on every method and just describe the method in either @return or @param flags.

Can you replace this with proper javadocs as found in the rest of the codebase, describing the method in a normal javadoc body and the specific return/param value in the tags.

rustic folioBOT
#

Expected behavior

BlockPhysicsEvent should always be cancellable.

Observed/Actual behavior

With a plugin cancelling all BlockPhysicsEvent, no physics should be "played".
Now, the physics cancelled are only those when you break a block below another one. If you try placing sand where it could fall, it will even if it shouldn't.

See this video for better understanding : https://youtu.be/I8pPa0my7lk

Steps/models to reproduce

Create a plugin cancelling physics
Try to pla...

rustic folioBOT
#

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

CraftBukkit Changes:
4f7ff4dec PR-1246: Add missing AbstractTestingBase to tests which need them
f70a7b68d SPIGOT-7465, MC-264979: Fresh installations print NoSuchFileException for server.properties
8ef7afef6 PR-1240: Call BlockGrowEvent for vines that are growing on additional sides of an existing vine block

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

When any player clicks on a message with a callback click event the callback should be called normally.

Observed/Actual behavior

When sending a non-op player a component with an callback click event attached to it the player will only receive a message that the command could not be found (because he has no permission for /paper and therefore not for /paper callback) Unknown command. Type "/help" for help.

Steps/models to reproduce

// Player sh...
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

Following #6464. event.getLocation().getBlock() returns AIR during StructureGrowEvents involving trees. Prior to this PR, it would return the sapling that the tree grew from. It appears that there is no way to figure out what sapling was involved in a StructureGrowEvent without using TreeType and mapping all types to the correct sapling.

Describe the solution you'd like.

A method of accessing the type of sapling (or other original blo...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

As in earlier versions, the nodding does not happen, they look straight at you

Observed/Actual behavior

Mobs / animals nod when you stand on a pedal flower (1.20 biome flower) after a while when they look at you.

Steps/models to reproduce

  1. Place a pedal flower next to you
  2. Spawn a mob / animal next to you that can walk and look at you
  3. Stand on the flower and observe the mob / animal
  4. When they look at you, they rarely nod a few times in a weird w...
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Basically what you mean is to allow for the list to be able to add/remove players (basically allow spawners to be activated at any range?).

In my opinion I don't think this is a desirable outcome as basically it will allow spawner's to functionally be always active which in my case would be opposite of the PR.

Although, I could add something like the following (not sure if this is what you meant!), although I don't think it would be great.

private List<Player> activatingPlaye...
rustic folioBOT
#

Timings or Profile link

https://spark.lucko.me/3LUGkngcdt

Description of issue

Everytime I enable Anti xray in the World-defaults config file. The server ram creeps ups slowly but it doesnt stop eventually it surpasses the max amount of allocated memory Which is 8GB Just to note there is at most 5 people playing at a time. And once that happens the tps drops down to 15-17 (5-10) in extreme cases and if left on for too long eventually crashes.

I have run the server without any p...

rustic folioBOT
rustic folioBOT
#

The methods now take an optional component that overrides the title of the container.

Multiple questions:

  • What should be best done with this patch and patch 927 because they both touch the same line of code?
  • Should I group the methods for openWorkbench, openEnchanting, openVillagaer and openMerchant below the respective default method or can this be kept this way?
  • Does it even make sense to offer these extensions for openVillagaer and openMerchant? I just added them at the momen...
rustic folioBOT
#

Is your feature request related to a problem?

Now the restrictions on the book are quite comprehensive, but I feel that there are still some shortcomings
Most people have a vague idea of word count

Describe the solution you'd like.

The book can save 100 pages by default, can you add an option to customize the maximum number of pages of the book, such as the maximum number of pages of 20 pages
It seems nice to give tips on restrictions
Instead of kicking out the player directly
...

rustic folioBOT
rustic folioBOT
#

The existing options (in the global configuration, book-size) already allow you to ensure that a book doesn't get too large for the server to handle, though the default values aren't perfect.
They are configured in bytes and not pages, because pages can have very different sizes depending on the characters used on them.
Because of this, a page limit isn't really the best way to protect against book-related exploits.

If you want to limit the page count for some other reason, a plugin can d...

rustic folioBOT
rustic folioBOT
#

The existing options (in the global configuration, ) already allow you to ensure that a book doesn't get too large for the server to handle, though the default values aren't perfect. They are configured in bytes and not pages, because pages can have very different sizes depending on the characters used on them. Because of this, a page limit isn't really the best way to protect against book-related exploits.book-size

If you want to limit the page count for some other reason, a plugi...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

I've just run into this as well. The commands.yml aliasing doesn't seem to work correctly when I try to override WorldGuard's locate command to go back to the Mojang version, and it continues to use the plugin's version of the command rather than the alias taking precedence over it as described in the PaperMC documentation. The wglocate alias I've added below works as expected, and calls the plugin's version of the command.

WorldGuard an...

rustic folioBOT
rustic folioBOT
#

Adds an event that gets called whenever a LootTable rolls any loot.
There are two aspects I'm not sure about:

  • Whether this should be a ServerEvent, or a WorldEvent like the LootGenerateEvent (but just forwarding the world from the LootContext location seems a bit pointless)?
  • If this is the best way to implement / call such an event. The goal was to have a general event for all loot table rolls, but this implementation only covers loot generated via LootTable#getRandomItems method retur...
rustic folioBOT
rustic folioBOT
#
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

https://github.com/PaperMC/Paper/assets/135555687/3245f6c0-32fa-4294-b536-2db4fca621ec

https://spark.lucko.me/QlUlf6Jzcj

Paper's Nether portal itself seems to cause a large lag, and the ghast generation speed is slower, so it will constantly unload and load the portal, a veritable lag machine.
But sometimes after the server on my other machine restarts, this lag disappears, it may be which thread is wrong, from time to time, I don't know, but I can be sure that spigot will not have s...

rustic folioBOT
rustic folioBOT
#

I'm unable to reproduce this issue, as the schematic you provided also does not seem to be a working farm; the villagers have constant line of sight with the zombie which prevents them from sleeping. After replacing the soul sand and trapdoors with solid blocks and removing the slabs, villagers sleep normally and iron golems start spawning. The beds also have occupied permanently set to true in their nbt data, which also prevents villagers from sleeping, replacing the beds fixes that.

The ...

rustic folioBOT
#

Is your feature request related to a problem?

Some developers expect to use the commands section in the paper-plugin.yml as they do in the plugin.yml. This is unsupported, which causes calls such as getCommand("myCommand").setExecutor(someExecutor) to fail with a NPE.

A NPE does not immediately explain the cause of the bug, namely that the developer expects to use the commands section but the commands section is no longer a feature. So the developer revisits the paper-plugin.yml, ...

#

Is your feature request related to a problem?

With the advent of Paper plugins, calling into the CommandMap for registration is now recommended over the plugin.yml's commands section. The CommandMap#register method exists; however, there is no #unregister method. Yet plugins would benefit from de-registering; for example, if the plugin implements configurable aliases, or if it is a dedicated alias plugin outright.

Describe the solution you'd like.

Add a CommandMap#unregister method...

#

Expected behavior

normal chests

Observed/Actual behavior

chests visual lag, the part of chest or full chest is disapearing only visual

image

Steps/models to reproduce

dont know

Plugin and Datapack List

[18:17:04 INFO]: Server Plugins (66):
[18:17:04 INFO]: Bukkit Plugins:
[18:17:04 INFO]: - AdvancedBan, ajLeaderboards, AntiCombatLog, ArmorStandEditor, AureliumSkills, Bendi...

rustic folioBOT
rustic folioBOT
#

The harderdespawn plugin seems like it does exactly what you're asking, it removes mobs on chunk unload immediately, which allows you to keep the despawn ranges the same.

Yes I know, I'm using this plugin right now, but only when the block is unloaded, the mob disappears, the bio farm is long term afk, and it may still not work well
Despawn Range (hard)
best option really would be to add an option to let the y check essentially be configu...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Timings or Profile link

unrelated

Description of issue

Recently I noticed that the network activity has increased quite a bit. The measurements are done with the built-in Resource Monitor in Windows.

Reproduction steps

  • Create a plugin with this code, add required dependencies (to get access to the server classes you need to build NMS or paperweight), build and add to your server's plugins
// Create header and footer fiel...
rustic folioBOT
#

just to be sure (since you put 169 as paper version), you are reporting a regression introduced by this commit https://github.com/PaperMC/paper/commit/d6d4c78e7d88f3fcd274bceab1e6b022224096ef (build 40) two months ago?
because the code you posted doesnt worth on the version before that commit since that commit brought in the async scheduler.

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Mhm, yes, I was considering pinging @4drian3d whose plugin SignedVelocity relies on command and chat events. However, this PR is only for the ServerCommandEvent, so that plugin will not be affected.

Other plugins might. Really, dispatching a console command is something of a universal interface between plugins, and lots of plugins implement features that use dispatchCommand to call into other plugins in certain places when timing is appropriate: shop plugins when granting purchases, sk...

rustic folioBOT
#

Sorry, I'm reporting this issue again.
I have this on both computers, they are both Windows 11, and the probability of occurrence is very high.
After I switched Windows 11 to Ubuntu 22.3, the lag spike disappeared, and I was also confused, it will only happen with Windows 11.
The CPU models are i5 11400F and i5 12400
The system uses Ubuntu 22.3, and the lag phenomenon does not occur

rustic folioBOT
#

Closes #8947

Moves the deactivate event call into the onRemove method for the beacon block itself to prevent it from running when the block entity is unloaded. Also fixes an issue where the events were not being called when the beacon beam gets blocked.

The field I added feels a bit wrong but it works, it's to prevent the activation event being called immediately after loading, can't see any better way to differentiate between a newly placed beacon and a newly loaded one.

rustic folioBOT
#

I created this PR because in my opinion, an event should be fired because, as the javadocs says : "This event is called when a command is run by a non-player.". As dispatching a command with the console is running it by "a non-player", i though that it would be legitimate.
The more, this patch keeps the purpose of the event : being able to log executed commands.

image

I understand that maybe some ...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

The event should be called only once, when the chunk is unloaded.

Observed/Actual behavior

EntityRemoveFromWorldEvent is called in a loop for minecarts that are in an unloaded chunk.

Steps/models to reproduce

Place a minecart on a rail, then make sure the chunk is unloaded (by teleporting far away).
If you have a plugin that listens to EntityRemoveFromWorldEvent, you'll see the event is fired every second.

Plugin and Datapack List

Paper version...

#

I am unable to replicate this on latest paper.
The plugin logic

@EventHandler
public void on(final EntityRemoveFromWorldEvent event) {
    Bukkit.broadcast(Component.text(event.getEntity().getName() + ":" + event.getEntity().getUniqueId()));
}

yields exactly one unload for a minecart placed on a normal rail (placed at 10000/100/0). Both walking away from the chunk as well as teleportation to 0/100/0 only triggered a single event call. Are you sure you are not trying to l...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Thanks for the info @GoldenEdit. We're aware of this issue and will hopefully be able to improve the performance around VoxelShape. Are you able to provide a zip of a world (or part of) with the farm you have please?

When reproducing this I was only running a quick test by spawning Ghasts directly into the portal.

I may be able to provide you with a WorldEdit schematic of one of the farms on a server I manage, let me know if you would like that.

This issue happens anytime a ghast enters...

rustic folioBOT
#

Thanks for the info @GoldenEdit. We're aware of this issue and will hopefully be able to improve the performance around VoxelShape. Are you able to provide a zip of a world (or part of) with the farm you have please?

When reproducing this I was only running a quick test by spawning Ghasts directly into the portal.

I may be able to provide you with a WorldEdit schematic of one of the farms on a server I manage, let me know if you would like that.

This issue happens any...

rustic folioBOT
rustic folioBOT
#

Some quick googling revealed that jdk.internal.misc.Unsafe.park is an internal Java function which causes the program to halt temporarily until some condition is met. In this case, it seems like some incident is doing some background calculations asynchronously which interfere with the event loop for Minecraft, causing the tick to be halted until it finishes. As for which incident, it is impossible to say without a much deeper dive

rustic folioBOT
#

Timings or Profile link

NULL

Description of issue

I've always been bothered by the occasional lag in Nether portals
I spent two days sifting through the versions
Eventually locating to paper-1.19.2-174, which added the Rewrite chunk system, was a feat
But on Windows systems, there seems to be some lag issues,Lag doesn't happen on Ubuntu(Linux)
When I use paper-1.19.2-173 (without the Rewrite chunk system), the lag doesn't happen
I've been troubleshooting the cause for months, ...

rustic folioBOT
#

ๆ‚จๆญฃๅœจ่ฟ่กŒไธๅ—ๆ”ฏๆŒ็š„ Minecraft ็‰ˆๆœฌ ๏ผˆ1.19.2๏ผ‰ใ€‚ๆญคๅค–๏ผŒ่ฏทไปฅๅŽๆŒ‰็…งๆœ‰ๅ…ณๆ’ไปถ/ๆ•ฐๆฎๅŒ…ๅˆ—่กจใ€้…็ฝฎๆ–‡ไปถใ€็บธ่ดจ็‰ˆๆœฌๅ’Œๅˆ†ๆžๅ™จ้“พๆŽฅ็š„้—ฎ้ข˜ๆจกๆฟ่ฟ›่กŒๆ“ไฝœใ€‚

I said paper-1.20.1-169 is affected as such, please don't close

rustic folioBOT
rustic folioBOT
#

We really have little care about windows, it's well known that file Io is much slower on that platform, and unless something shows that the issue is elsewhere, there's little we can do other than advising to maybe try to toy with the number of Io workers.

Outside of that, we'd need a trace showing all server threads when that occurs, which I'm pretty sure across the GitHub and discord, I've asked enough times that I no longer care with how much my head is spinning.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Imho there's 4 solutions:

  1. We'll wait until it got approved for the gradlePluginPortal()
  2. I add this plugin to the paper repo's buildSrc or similar
  3. I can upload it to maven central
  4. or we just forget about it and live with the double annotations

Please let me know if you're interested in adding this at all, because if not, I don't have to waste time into getting it approved for the plugin portal and/or uploading it to maven central

rustic folioBOT
rustic folioBOT
#

I like this on principle, but is using regex really the best approach here? Also, I guess ideally it would be fixed in the javadoc generator, anybody ever tried to chase that down?
Kinda related to stuff, I wanted to edit javadoc files anyways to add like a navigation to navigate projects and versions and add an alert if you aren't viewing latest, but I guess that would be suited better for the software who serves the javadocs

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

When using the steps to reproduce code, the loot should populate without error.

Observed/Actual behavior

When using the steps to reproduce code, an error occurs at LootTable#populateLoot():
java.lang.IllegalArgumentException: Missing required parameters: [, , , , ]

Steps/models to reproduce

LootContext.Builder context = new LootContext.Builder(block.getLocation()); LootTable table = Bukkit.getLootTable(key); table.populateLoot(null, context.build());
...

rustic folioBOT
#

This is 100% not something that can be done mid patch release, this is more a major change in behavior in which needs to be done on a major release with proper testing to ensure that we don't break anything;

This is how this logic has worked for a decade, and while you can maybe argue that it's weird, it is a side-effect of various dozen other choices in the codebase over a decade which has left us here

rustic folioBOT
#

Yea, this logic would be desirable in the long run imo, it just
a) would best fit something like, 1.21 release
b) might be best to wait for papers hardfork or be proposed to spigot.

Given that the quit/onDisable stuff has worked like this for years and most logic that relies on this logic deals with rather crucial parts of plugins (e.g. data saving) changing this mid version is rather terrible for plugin developers to update.
Additionally, given that this breaks spigot compatibility, im...

#

a config option was proposed for /stop to boot everybody, but there is no expectation that it would change event behavior, the server has stopped ticking and many things relied upon that in order to fire events, etc;

If we're going to change the behavior around this, it should just be changed without a config option, rather than having such a dangerous setting sitting around with massive side-effects

rustic folioBOT
#

I don't think the bug is going to be fixed in the javadoc tool anytime soon.

I meanwhile did some improvements to the fix-javadoc-plugin. I have let it generate the full paper API docs and uploaded them here, in case anyone is bored feel free to check them out and let me know if you can find any issues (like e.g. still duplicated annotations, or maybe even missing correct annotations or anything).

As mentioned, I'd be happy to eithe...

rustic folioBOT
rustic folioBOT
#

Ok so I have looked into this for a while and it seems that its not really a possibility to just check-and-print if there is a command section in the paper-plugin.yml.
It seems that a methods get a BufferedReader which is then converted to a PaperPluginMeta instance in a builder. Then its already too late to check if there is a command section because it just doesn't parse it.

public static PaperPluginMeta create(BufferedReader reader) throws ConfigurateException {
    Yam...
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

This PR adds a simple warning if a commands section has been found in the paper-plugin.yml file.

I am taking suggestions for the warning message since I don't know if I should include how to register commands with Paper Plugins.
I also did not know which logger I should use since I don't think a plugin logger has already been created at the time where the warning is printed.

Which brings me to the next point:
Currently the warning is printed before the server is started:

#

Tbh, It's a bit worrying that people are using these plugins like this, to the point where we need to warn if they aren't even reading the documentation.
image

That format is still very much subject to change, and in all honesty, I would rather have some kind of warning if a paper plugin is being loaded... because those are very much still experimental and are waiting for future API.

#

That is a good point. But I think the one thing has little to do with the other.
I think many people are creating a Paper plugin with the MinecraftDev IJ plugin and don't even realize that its different to Bukkit Plugins. So what you suggested should probably be handled over there by adding a little warning next to the paper manifest checkbox.

You can see it in the Discord that people are even too lazy to read JavaDocs so we cannot assume that they read the docs. The best thing we can d...

rustic folioBOT
#

And if a developer is actively handing out Paper plugins, /shrug what fun.

There are already plugins published on Modrinth using the paper-plugin.yml. I recall viewing this myself.

With all due respect, one should not publish an API to a popular project without expecting its use. The adoption of Paper plugins began as soon as a newfangled API for declaring plugin metadata was released. These shifts are not necessarily misguided, as the original impetus for Paper plugins outlined sever...

rustic folioBOT
#

With all due respect, one should not publish an API to a popular project without expecting its use.

We do expect usage of the API, hence we published it. To collect feedback on it as we further improve it.
I don't think anyone minds people publishing paper plugins, IF they are aware of the contracts that come along with the usage of paper plugins, specifically changes to format, abi, api without backwards compatibility promises, as explicitly defined via the docs page and the ex...

rustic folioBOT
#

There are already plugins published on Modrinth using the paper-plugin.yml. I recall viewing this myself.

Personally, I have more than 10 public plugins made based on a paper-plugin.yml, I am fully aware that there will be changes in the structure of this type of plugins in the future and I have no problem to update my projects based on the new changes.
What I don't agree is to add a warning in console about a paper plugin being loaded, because there would be users asking about the wa...

rustic folioBOT
#

another warning in their server logs isn't going to help much.

In my opinion its generally wrong to say that "it wont help much". If we have the opportunity to make it more user-friendly we should use that opportunity I dont think a warning doesn't hurt anybody.

Another idea that had already been mentioned is that we could throw an exception instead of just printing a warning. That way 90% would actually read the message.

But I am generally against this approach since it would be kind ...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

What if, instead of checking the paper-plugin.yml for a commands section, we print a warning if JavaPlugin#getCommand() is called by a paper plugin?

@Nullable
public PluginCommand getCommand(@NotNull String name) {
    // Paper start - print warning if paper plugin
    if (getResource("paper-plugin.yml") != null) {
        this.logger.warning("---------------------------------WARNING--------------------------------");
        this.logger.warning("         Defining comma...
rustic folioBOT
rustic folioBOT
#

After testing, seems to work well.
However, I am a bit bleh about the naming of the event after thinking about it.
It isn't really pre-search, the "heavy" searching logic is still executed.
The backoff ticks can prevent that, but the event is not really pre- anything.

Yep, more I coded, the more I thought maybe it should just be called "SpawnerSearchEvent".

rustic folioBOT
rustic folioBOT
#

but there gotta be a nice instanceof check we could do

i changed it to

if (!(pluginMeta instanceof PluginDescriptionFile)) {
    this.logger.warning("---------------------------------WARNING--------------------------------");
    this.logger.warning("         Defining commands in paper-plugin.yml is unsupported!          ");
    this.logger.warning("      Please refer to the docs for proper command initialization!       ");
    this.logger.warning("https://docs.papermc.io/...
rustic folioBOT
rustic folioBOT
#

You provided no type for your LootTable. By default, the ALL_PARAMS type is used, which requires all LootContextParams to be set. Craftbukkit does not handle that correctly, so you get an error.
Providing a type should fix the issue, though this should be handled better by the API.
You can use the EMPTY type for one that does not require any parameters:

{
  "type": "minecraft:empty",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "m...
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Adds API to handle the individual experience points of a player. This is what the existing get/setTotalExperience should have been, but we never got.

I know that the implementation is kind of top-tier cursed, but thanks to the three different equations Mojang has choosen this is what it is. If something like this is not desired in Paper just close the PR, although it would be nice to have.

I have tested this method up to I think it was around 39,000,000 experience points/level 2961 an...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

what is the difference here to the other method? that should definitely be documented on both methods, old and new, so that we dont leave people guessing or having to look at the code (which I cant right now, hence the question)

To quote the JavaDocs for the existing methods:

Gets the players total experience points.

This refers to the total amount of experience the player has collected
over time and is not currently displayed to the client.

As far as I can tell the curren...

rustic folioBOT
#

Expected behavior

PlayerInventorySlotChangeEvent should trigger when swap item with offhand in container

Observed/Actual behavior

PlayerInventorySlotChangeEvent not triggers when swap item with offhand in container
https://youtu.be/A3zPAAu2l8w

Steps/models to reproduce

    @EventHandler()
    public void onSlotChange(PlayerInventorySlotChangeEvent event) {
        Player player = event.getPlayer();
        ItemStack oldItem = event.getOldItemStack();
        ItemSta...
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

You provided no type for your LootTable. By default, the ALL_PARAMS type is used, which requires all LootContextParams to be set. Craftbukkit does not handle that correctly, so you get an error.

Providing a type should fix the issue, though this should be handled better by the API.

You can use the EMPTY type for one that does not have any parameters:


{

  "type": "minecraft:empty",

  "pools": [

    {

      "rolls": 1,

      "entries":...
rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: feature/improve-java-version-check
#

misses a proper link to the docs site

tested with these things:

D:\IntellijProjects\PaperClean\run>D:\Programms\graalvm-ce-java19-22.3.0\bin\java.exe -jar paper-bundler-1.20.1-R0.1-SNAPSHOT-mojmap.jar      
Starting org.bukkit.craftbukkit.Main
System Info: Java 19 (OpenJDK 64-Bit Server VM 19.0.1+10-jvmci-22.3-b08) Host: Windows 11 10.0 (amd64)

D:\IntellijProjects\PaperClean\run>D:\Programms\graalvm-jdk-20.0.2+9.1\bin\java.exe -jar paper-bundler-1.20.1-R0.1-SNAPSHOT-mojmap.jar
...
rustic folioBOT
rustic folioBOT
#

Adds Foiled/Glow API using NBT.

Possibly can add the API to the Overrides for the default items that are foiled.

Relevant:
#5274

Also not sure if this is going to be relevant due to #8711.

P.S. For some reason Patch 1018 was edited and it says it removed something? I also can't rebuild or apply new patches after rebuilding the first time which is confusing to me.

#

I honestly think this might be best to keep for property API.

There is certainly a need for "glowing" but given that mojang does not support this natively without the empty enchant array, exposing this to the API seems a tad bleh, we are kinda just hacking for the plugin user abusing the "quirk" that the client still displays enchantment glint on an empty but present enchantment array.

imo it is a mistake to promote this to a stable API interface like ItemMeta. The property API would ma...

rustic folioBOT
#

There is certainly a need for "glowing" but given that mojang does not support this natively without the empty enchant array, exposing this to the API seems a tad bleh, we are kinda just hacking for the plugin user abusing the "quirk" that the client still displays enchantment glint on an empty but present enchantment array.

So is the client not detecting the following server code?

public boolean isEnchanted() {
        return this.tag != null && this.tag.contains("Enchantme...
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

I think it would be best to move all this logic to before the instabuild check on line 20, so that the event is called before data is created & saved. We could create a map item manually and add the next map id (without incrementing the counter incase of cancellation) to the tag, then replace that MapItem#create with MapItem#createAndStoreSavedData and pass in the itemstack from the event.

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Do you have any link to a place this issue you're fixing has been reported at and/or reproduction instructions? As it stands, this PR has a few issues which makes it not mergable:

  • Sending a block entity update packet doesn't do anything in terms of desync
  • This will cause an NPE if there is no block entity where the client thinks there is one
  • There is no range check done
rustic folioBOT
#

Expected behavior

A detector rail is only triggered when a minecart drives over it.

Observed/Actual behavior

Detector rail is sometimes triggered when a minecart drives next to it.

Steps/models to reproduce

YT-Video: https://www.youtube.com/watch?v=frW0af0Dhbs
Litematica schematic: detector rail bug.zip

Plugin and Datapack List

Bukkit Plugins:
GriefPrevention, Multiverse-Core, Multiverse-Invent...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Can you please further explain your change here? This part of the code is rather sensitive, and would appreciate why exactly you are making this change here.

Since, you are eliminating two places where the block ack occurs. But it doesn't really make sense why these acks should be cancelled, as if the client does introduce something like this (which may be due to a desync) it would make sense to do this ack to revert it clientside.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Can you please further explain your change here? This part of the code is rather sensitive, and would appreciate why exactly you are making this change here.

Since, you are eliminating two places where the block ack occurs. But it doesn't really make sense why these acks should be cancelled, as if the client does introduce something like this (which may be due to a desync) it would make sense to do this ack to revert it clientside.

Additionally, this causes a bit of a desync a...

rustic folioBOT
#

Is your feature request related to a problem?

There is missing documentation for the SCULK and SCULK_CHARGE particles in the Javadocs; there's no information on the required data for these particles.

SCULK particles have integer data for a delay (in ticks I believe) and SCULK_CHARGE have float data for a "roll" which just basically rotates the particle

Describe the solution you'd like.

Added documentation for these particles

Describe alternatives you've considered.

I've co...

rustic folioBOT
#

You are free to benchmark this on your OWN, this benchmark from my part was done on DonutSMP events, that get around 700-800 players in a close 400x400 area where there's a lot of Crystal PVP everywhere, lots of chunk interactions etc, compression is highly necessary on environments like this, and a few servers also use this, it's a quick change and most users shouldn't ever feel any need to have this changed but it's a good software improvement if you confirm this should be applied.

This ...

#

You are free to benchmark this on your OWN, this benchmark from my part was done on DonutSMP events, that get around 700-800 players in a close 400x400 area where there's a lot of Crystal PVP everywhere, lots of chunk interactions etc, compression is highly necessary on environments like this, and a few servers also use this, it's a quick change and most users shouldn't ever feel any need to have this changed but it's a good software improvement if you confirm this should be applied.

T...

rustic folioBOT
rustic folioBOT
#

If there is ever API for DamageSources and the CombatTracker, I could see a timestamp added to each DamageSource being useful, because then time, involved entities, direction and type of each instance of damage received would be together.
But currently I fail to see the advantage over just listening to the event and storing the timestamp yourself.

Vanilla only tracks combat start and end time as well as the time since the last attack, not timestamps for individual damages.

rustic folioBOT
#

But currently I fail to see the advantage over just listening to the event and storing the timestamp yourself.

Mostly it's because this is a trivial object addition to an event whereas one would need to start managing HashMaps etc for this would would certainly be more effort, memory cost, and the like. It's certainly not a vital addition but I could see it being useful for others. All else fails I'll just continue using it in my fork.

rustic folioBOT
rustic folioBOT
#

Expected behavior

I am aware that I'm running a fork of paper, if this is an issue for you then I don't know what to tell you, this works on paper as well, if you don't want to patch this simply because of me running a fork then that's fine.

[20:49:37] [Server thread/ERROR]: Failed to handle packet net.minecraft.network.protocol.game.PacketPlayInWindowClick@2e16f2ab, suppressing error
net.minecraft.ReportedException: Container click
at net.minecraft.world.inventory.AbstractConta...

rustic folioBOT
#

To patch this, in the AbstractContainerMenu's doClick method when the action type is quick craft it tries to get the slot from an array based on the slot that was sent in the packet, the default minecraft server (and spigot, paper..) allows slots -1 and -999 to go through but don't validate that slot in the doClick method before trying to get it from the slots list which throws an IndexOutOfBoundsException

As I don't have time to whip up my own client right now and figure out how to cause ...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Please provide actual reproduction instructions, how are you summoning the endermite? Only ones spawned naturally will attract them

The Enderman monster spawning tower I originally used can be used normally.
When I update the paper version, it can no longer be used.
Monsters occur naturally
When I actually tested Endermite's hatred value, there was less than 10 blocks left.
The wiki says there is a 64-frame range

rustic folioBOT
#

Throughout the MC codebase to avoid the math.sqrt function (expensive) the distance checks are made on squared values.

If the classic formula is math.sqrt((x2-x1)ยฒ+(y2-y1)ยฒ) < limit

then removing sqrt on both sides of the equation leaves (x2-x1)ยฒ+(y2-y1)ยฒ < limitยฒ

The ...distanceSquared function should be somewhere in vanilla. Please double-check me on the 0.5dยฒ value.

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Ok so I have tried this and I don't seem to be able to do that.
It tells me that No TypeSerializer found for field compressionLevel of type class io.papermc.paper.configuration.type.IntOr$Default, before it just did not want to create the misc section at all.
To my eyes I have made everything like where it is already in use.
The updated GlobalConfiguration variable:

public IntOr.Default compressionLevel = IntOr.Default.USE_DEFAULT

The updated line in `Connection#setu...

rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: brain-activation-distane
rustic folioBOT
rustic folioBOT
#

I spent a lot of time fielding complaints from players about this: entities in the distance behaving dumbly (piglin brutes being basically pacifist sometimes), mobs dying for all sorts of reasons (see above) like drowning or suffocation, mobs not reacting properly to plugin actions (like being statue-ified for a bit after teleporting), lots of normally Paper-compatible and fairly innocent farms sporadically and unpredictably breaking, or becoming so slow or stuck at typical distances that it ...

rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: brain
#
[PaperMC/Paper] branch deleted: brain-activation-distane
rustic folioBOT
rustic folioBOT
#

Expected behavior

Whenever an entity goes onto a wire connecting two tripwire hooks, there should fire two induvidual BlockRedstoneEvents for the two related tripwire hooks.

For example, when an entity goes onto a tripwire with one end having a tripwire hook facing east, and the other end a tripwire hook facing west, then there should trigger a BlockRedstoneEvent once for both of the tripwire hooks.

Observed/Actual behavior

Only the east facing and north facing tripwire hook sho...

rustic folioBOT
rustic folioBOT
#

When preventing players from moving into unloaded chunks; I would argue that if a scenario arises where the player is attempting to move to a chunk which is indeed loaded, but is sandwiched between a one or more unloaded chunks it would be more beneficial for the method to return in a place where a warning message is explicitly logged rather than just silently not allowing the movement.

This can be done by ensuring that the location of the movement resides in an unloaded chunk.

rustic folioBOT
#

Expected behavior

A redstone pulse gets emitted whenever a player on a lectern changes the page of the book in the lectern. This should throw a BlockRedstoneEvent.

Observed/Actual behavior

No event occurs at all

Steps/models to reproduce

Make a testplugin with the following listener

    @EventHandler
    public void onBlockRedstoneEvent (BlockRedstoneEvent event){
        plugin.getLogger().log(Level.INFO, event.getBlock().toString());
    }

Create a book...

rustic folioBOT
#

Stack trace

[14:29:48 ERROR]: Failed to handle packet net.minecraft.network.protocol.game.PacketPlayInUseItem@37288ab, suppressing error
java.lang.IllegalArgumentException: Expected packet sequence nr >= 0
	at net.minecraft.server.network.ServerGamePacketListenerImpl.ackBlockChangesUpTo(ServerGamePacketListenerImpl.java:2195) ~[?:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1986) ~[?:?]
	at net.minecraft.netwo...
rustic folioBOT
#

Is your feature request related to a problem?

There are some cases in which BlockState is provided but it's not "fine". Fine in terms of being able to invoke BlockState#update.
One of such cases are https://jd.papermc.io/paper/1.20/org/bukkit/structure/Structure.html
Structures have a Palette, a BlockState collection with each BlockState having its Location as an offset from an origin.
There's an issue with Structure#place. This is done in a single tick and this affects performance (m...

rustic folioBOT
rustic folioBOT
#

No comment from me on this PR, There is no reports of this actually happening, I don't see a point of "fixing" such a hypothetical.

I wouldn't really refer to it as a "fix" per say, more just a slightly more elegant way of handling things. I would imagine a scenario like this would most likely arise out of a client using some form of movement hacking in which case it would probably be better to log as either "Player moved too fast" or "Player moved wrongly" rather than just returning sil...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

While the option to prevent players from moving into unloaded chunks does exist. I think its reasonable for a single check to made regarding weather or not the chunk which contains the destination of the movement is loaded or not. As I think its agreeable that having a player moving into a chunk which is supposed to loaded but hasn't yet is almost certainly unwanted behavior.

In high latency conditions where this is most likely to occur, ...

#

I don't see the point here ? The reason this is a config option is explicitly to allow moving into unloaded chunks if wanted.
This issue just asks for this option to be effectively useless ? Server owners that do not want players to move into unloaded chunks can simply enable the configuration option.

Can you please elaborate what exactly the usecase of this issue is beyond just, well, effectively making the configuration option useless and just enabling its behaviour by default without a...

rustic folioBOT
#

The config option will take any and all chunks between the clients current position and their final movement position and continue checking them until a chunk is unloaded from my understanding the goal of this behavior is to trade more rubberbanding for a more stable TPS. Some server owners might not want to make this tradeoff and hence leave the option in its default state. What I'm proposing is a singular check done not on all chunks in between but rather only the destination chunk, rubberb...

rustic folioBOT
#

I mean, this seems like an edge case right ?
For this to actually have any effect you'd need to

  1. be fast enough to skip an entire chunk in a single move packet. Elytra and boats might do this.
  2. the chunk you skip into has to be loaded while the chunk you skip has to not be loaded.
  3. 1 & 2 need to consistently occur, a single move packet landing you in an unloaded chunk would still rubberband you back.
    At these speeds, it'll still be a noticeable rubberbanding effect if you are...
#

Expected behavior

Normal treasure map

Observed/Actual behavior

i see the empty treasure map, with no X or dot on it

Steps/models to reproduce

i dont know how to reproduce it

Plugin and Datapack List

[20:31:04 INFO]: - AdvancedBan, ajLeaderboards, AntiCombatLog, ArmorStandEditor, AureliumSkills, BendingGUI, BetterRTP, BetterStructures, BlockRegenerationPlugin, BlueSlimeCore
[20:31:04 INFO]: BossCooldownPlugin, ChatBubbles, ChatEx, Chunky, Citizens, ClansLite, CMILib, ...

#

Yeah I guess it is a bit of an edge case, although I think it raises the question of why we even need to construct an AABB which encompasses all chunks in between the player and destination, if its very unlikely that more than one check is needed to determine if the player lands up in an unloaded chunk, while at the same time opening up an opportunity for players with malicious intent to create lag by spamming out movement packets in chunks far away from their current location, racking up lar...

#

I mean, I agree with your first block, limiting the full AABB chunk loading search and simply deeming a move packet invalid if the player were to skip too many chunks might be a worth concept to explore, spigot already has the "moved too fast" checks, this could simply live after instead of before said checks.

However, I disagree with an option for this that server owners do not have to enable. Adding checks like that without owners specifically enabling them would break existing setup...

rustic folioBOT
#

Ah okay I understand your points of concern.

Although I am interested in exploring this AABB thing further. Thinking about it more, I would argue that there are more cases where simply checking the destination chunk is better than expanding an AABB, obviously there's the micro optimization of having physically having to do less work, however I believe this also ties into a point I made in this PR - https://github.com/PaperMC/Paper/pull/9717 about having messages logged to server console. ...

#

I mean, the point of the current check is to prevent what you proposed in this issue: Skipping unloaded chunks.

This is intended behaviour right now and I'd argue it is expected behaviour. Being able to teleport through unloaded chunks when the option to prevent movement through unloaded chunks enabled, seems odd.

The fact that these single move chunk skips exists, is merely a result of the fact that networking exists and we only get these packets in a given interval, not continuously....

#

To me it feels like the placement of this check above all other checks if kind of to act as a short cut out of the other checks, I don't know I could be wrong about this but intuitively it feels like doing a check to see if the chunk the player is moving into is even loaded is an obvious first step to determining if a movement is valid or not. To me it just feels like a check like this is an easy to to circumvent needing to do other checks later down the line, and therefore should be done fir...

#

I mean, the first check should just be the distance check imposed by spigots moved to quickly.
The chunk checks are stupidly fast given they evaluated the ticking thread and don't need to acquire locks.

The AABB usecase is certainly more than most people will need when they move a single chunk, but it is not much overhead for it either. Moving a single chunk will realistically only end up with the single check anyway + the few calculations to get there, which is a couple multiplications a...

rustic folioBOT
#

As machine said, there might simply not be a treasure around in the max radius.
You can simply share the level.dat that includes the seed any any other generation configs. No need to provide the entire world.
However, please make sure that this does not happen on the world in vanilla (generate the world in vanilla by copying the seed, go to where you found the map, see if it finds something), as that would suggest that well, you might have been out of luck.

rustic folioBOT
#

I was able to figure out a way of going around it. It forces using reflection. I'll provide details:

In a nutshell, it requires exposing in the method both CraftBlockState's "position" and "world" fields.
Then in the new method (as I suggested as an approach), which would be update(boolean,boolean,@Nullable Location)
the idea would be that if Location is null, to execute as it normally does. Else, if injected dependency Location is not null, it would make an instance of BlockPosition pas...

rustic folioBOT
rustic folioBOT
#

Still encounter this bug in 1.20.1
Maybe try this case: build a piston (normal or sticky), and then keep this piston running. Then build a nether portal nearby, and wait random times. StarLight will receive a ChunkPos#toLong = -1, and then crash the server.

java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 33
	at it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.rehash(Long2ObjectOpenHashMap.java:1297) 
	at it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashM...
rustic folioBOT
#

Could probably get rid of the somewhat ugly check here by just

final int currentRedstoneLevel = state.getValue(LecternBlock.POWERED) ? 15 : 0, targetRedstoneLevel = powered ? 15 : 0;
if (currentRedstoneLevel != targetRedstoneLevel) {
    final org.bukkit.event.block.BlockRedstoneEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(world, pos, currentRedstoneLevel, targetRedstoneLevel);

    if (event.getNewCurrent() != targetRedstoneLevel) {
        r...
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

This breaks (possibly) expected behavior for the detector rail as it currently operates. I created the setup below and summoned a minecart at varying points on the track horizontally. In vanilla, I could spawn it on 3/10ths of the adjacent block and it would still trigger the detector rail. With this PR, the position has to be within the detector block x/z coord.

#

Hi, welcome to paper!
Thank you for the contribution, however the issue you are trying to fix is already being tackled by two open PRs :sweat_smile:

Beyond that, it seems like you ran into some trouble with the patch system, an updating to the Bukkit module is not really how the repository works for paper-specific code.
If you find another issue you want to work on, feel free to stop by our discord for some help with the patch system if you need it :)

Tha...

rustic folioBOT
#

This breaks (possibly) expected behavior for the detector rail as it currently operates. I created the setup below and summoned a minecart at varying points on the track horizontally. In vanilla, I could spawn it on 3/10ths of the adjacent block and it would still trigger the detector rail. With this PR, the position has to be within the detector block x/z coord.

From testing that I did prior to posting the PR, I used the sqrt(2) as the maximum distance (centre to corner). When I had used ...

rustic folioBOT
rustic folioBOT
#

Thank you for your third attempt at ensuring unloaded chunks stay untouched!
As with the two previous ones, this one does not look particularly bullet proof.
If you want to contribute to paper, maybe check for some easier PRs first before touching such delicate logic :+1:

To potentially save you and us some more time, none of these changes are going to be backported to 1.19 or Folia.
The version is end of life and will at best receive critical bug fixes.

Thank you for your contribut...

rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] branch deleted: feature/importing-data-files
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

When setting spawnpoint via bed or /spawnpoint player would spawn at the set spawnpoint.

Observed/Actual behavior

Player spawns at world spawn.

Steps/models to reproduce

.

Plugin and Datapack List

image

Paper version

This server is running Paper version git-Paper-163 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: 6f30f08)
You are 20 v...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

i open trade menu and push myself in ender gate using water and when i teleported to main island menu is still open

Observed/Actual behavior

i open trade menu and push myself in ender gate using water and when i teleported to main island menu is closed

Steps/models to reproduce

1:Open trade menu
2:teleport away from the villager to unload him
3:Menu is closed(but it shouldn't be this way)

Plugin and Datapack List

![image](https://github.com/PaperMC/...

#
[PaperMC/Paper] branch deleted: feature/improve-java-version-check
rustic folioBOT
#

After further consideration, I think this is not worth calling.
The event is cancellable so calling it and potentially cancelling a plugin run command could break way to many plugin to plugin interactions that rely on commands being executed.

E.g. right now plugin A might have to interact with a currency plugin B that does not have a public API.
For this plugin A calls dispatchCommand to execute a respective currency removal from plugin B.
Calling the event here means plugins could pote...

rustic folioBOT
#

Is your feature request related to a problem?

For many years now, the /bukkit:reload command is the worst nightmare of every plugin developer.
It breaks everything and should not act as a way to "restart" the server while running.

Describe the solution you'd like.

My proposal would be to drop the current behavior, and add a Plugin#onReload method or an event like velocity does.
This would probably be a good thing for the new paper plugins.

Describe alternatives you've cons...

#

Closing this in favour of #8859, generally the bukkit reload mechanic is flawed but touching it now that many people expect some form of broken behaviour seems troublesome.

I can 100% see a usecase for a better lifecycle (e.g. proposed in #4317) in paper plugins, but that can be discussed in the respective issue :+1:

#

I really dislike the notion of this; There are still some Qs over what we want to do long term here, ideally we wanna move away from the broken bukkit command system, however, the expectation of there still being an easy to use command system still exists, etc, etc; it's not 100% decided that such a commands block will never exist, I think that this issue would generally be better off solved with documentation and such

#

After some further discussion, this should properly address the API as well.
imo best to pass the entire SocketAddress to the PlayerLoginEvent and AsyncPlayerPreLoginEvent, deprecated the existing
methods yielded InetAddress and having them do the fallback, e.g. the API would have the

if (this.socketAddr instanceOf InetSocketAddress inet) return inet.getAddress();
return getLoopback()

and adding a new method that yields the plain socket addr.
Additionally, mark the cons...

rustic folioBOT
#

Generally I agree with you but good luck getting new people to read the docs. As I have mentioned before this is solely for the purpose of hinting new devs that they are doing something wrong. This can always be removed in the future but to be honest, there are too much plugin tutorials and people will use those tutorials to develope Paper Plugins in the future. So getting people away from the old system will never really work until we remove the methods entirely. And until then I think its a...

rustic folioBOT
rustic folioBOT
#

Expected behavior

The server will read all the lines when it starts

Observed/Actual behavior

All teams (66) are read normally on the first startup. But when it started up again after shutting down the server, there were only 7 teams left

Steps/models to reproduce

  1. Add as many teams as possible
  2. Use /team list to check all teams
  3. Stop server
  4. Restart the server
  5. Use /team list, and you can see that most of the teams were disappeared

Plugin and Datapack L...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

Clean loading of Shopkeepers plugin

Observed/Actual behavior

[08:56:10] [Server thread/WARN]: [Shopkeepers] Failed to load shopkeeper '1': Shopkeeper data migration failed!
com.nisovin.shopkeepers.util.data.serialization.InvalidDataException: Item migration failed for trade offer 1: SKTradeOffer [resultItem=UnmodifiableItemStack{BLAZE_ROD x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"bold":false,"italic":true,"underlined":false,"strike...
#

It appears something is overwriting ItemStack here which is explicitly not permitted in the bukkit API.
https://github.com/Shopkeepers/Shopkeepers/issues/842#issuecomment-1722495785 sounds plausible, please have the authors of the shopkeeper plugin look into this before opening an issue on paper.

If this turns out to actually be a breaking change under our current API promises, feel free to comment here, we will reopen the issue, until then this is a invalid issue :+1:

rustic folioBOT
rustic folioBOT
#

Expected behavior

The chest lid closes, the stat for opening ender chests is not incremented, nearby piglins are not angered

Observed/Actual behavior

The lid stays open, the stat is incremented and piglins are angered

Steps/models to reproduce

Listen to InventoryOpenEvent and cancel if the inv type is ENDER_CHEST. Then try and open an ender chest in game.

Plugin and Datapack List

none

Paper version

581b683931db32618aa676160b731a276a3a6730

Other

_No respo...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

An example problem would be if a plugin gives items to a player, but the player's inventory is full so the plugin drops the extra items on the ground, but the server has a feature where there is a collection box where the items should go to be collected.

Describe the solution you'd like.

An event added to PlayerInventory that is called when items are added. This event would happen after items are given to the player, but before the item...

rustic folioBOT
#

There is https://jd.papermc.io/paper/1.20/io/papermc/paper/event/player/PlayerInventorySlotChangeEvent.html, should get you rather far.

I am not a fan of the rather niche event the issue proposes. Events just introduced for the API calls also seems questionable.
What is the actual XY here ? Plugins calling addItem should handle the returned items gracefully.
If your plugin needs to interface with that, it should be on the plugin to allow you to do that, not us.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

Changing the direction of a painting should only change the direction of the painting

Observed/Actual behavior

Changing the direction of a painting change the direction of the painting AND its art is reset to the default one (clientside)

Steps/models to reproduce

Just a very simple plugin that change the direction of the painting once spawned later

Plugin and Datapack List

This test plugin

Paper version

3fd1502717e753405a74fbad4a16d2fd7a14187...

rustic folioBOT
#
@@ -1250,7 +1251,9 @@
             return;
         }
 
-        entityTracker.broadcast(this.getHandle().getAddEntityPacket());
+        for (ServerPlayerConnection playerConnection : entityTracker.seenBy) {
+            this.getHandle().getEntityData().resendPossiblyDesyncedEntity(playerConnection.getPlayer());
+        }
     }
 
     private static PermissibleBase getPermissibleBase() {

I think that updating the protected void update() method in CraftEntity i...

rustic folioBOT
#

Expected behavior

The scanForLegacyEnderDragon/enableFirstDragonSpawn world config doesn't work anymore since 1.20

Observed/Actual behavior

The scanForLegacyEnderDragon/enableFirstDragonSpawn world config should work

Steps/models to reproduce

Disable the config and go to the end (for the first time: delete the end world for already created server) -> notice how the dragon still spawn as if the config was on

Plugin and Datapack List

None

Paper version

3fd1502717e7...

rustic folioBOT
rustic folioBOT
#

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:
69c7ce23 PR-990: Use Mockito instead of InvocationHandler for test mocking
997de31d PR-893: Add a stream method to Registry to make it easier to use and to avoid unnecessary wrapping
6a8ce581 Fix malformed javadoc in previous commit
26c74f6d PR-890: Add more Sculk API (bloom, shriek, bloom event)
aa067ab...

rustic folioBOT
#
[PaperMC/Paper] branch deleted: update-upstream
rustic folioBOT
#
[PaperMC/Paper] New branch created: dev/1.20.2
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

Minecraft Java Edition released 1.20.2 a little over 2 hours ago. I'm unsure of the complexity that goes into updating the paper server so I just wanted to notify you all of the news and offer assistance in whatever way possible.

Describe the solution you'd like.

For the PaperMC Downloads section to provide 1.20.2.

Describe alternatives you've considered.

Official Minecraft website provides a 1.20.2 server.jar file.

Other

Li...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

While latest Java is 21, plugin developers still should stay on Java 8 because of retrograde server owners and hostings and thats like will be forever, until Minecraft itself will not force usage of latest JDK to allow plugin developers use latest features of Java, like switches, pattern matching, loom, string templates, enhanced instanceof, text blocks, structured concurrency, var, records, sealed classes, Stream#toList() and much more that ...

rustic folioBOT
rustic folioBOT
#

papers policy generally is supporting the latest two LTS versions, but obviously MC can set higher limits than that and we have to move with it (as we did in the past).
its expected that the next MC update will move to java 21.
paper will never require preview features, thats stupid, they aren't meant to be used in production. they are meant to be used by devs to give feedback to the jdk maintainers.

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

The main or offhand should be set to AIR

Observed/Actual behavior

A packet exception is thrown causing dupes in some cases

Steps/models to reproduce

Have a sword/any item in your mainhand and any item in your offhand at the same time, hit f while holding the main hand item and have this handler registered

  @EventHandler public void onSwap(PlayerSwapHandItemsEvent event) {
    event.setMainHandItem(null);
  }

Plugin and Datapack ...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: dev/1.20.2-log-ips-migration
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

The type used in SuspiciousStewMeta (PotionEffect) accurately conveys the information stored in the meta

Observed/Actual behavior

PotionEffect has 4 additional pieces of information that are not persisted in the itemstack nbt, only the type and duration are. This is not mentioned in the docs, but beyond that I don't think the use of PotionEffect is correct. See below.

Steps/models to reproduce

N/A

Plugin and Datapack List

N/A

Paper version

9...

#
[PaperMC/Paper] branch deleted: dev/1.20.2-log-ips-migration
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

In Spigot server, fake players can keep ticking chunks even if real players teleport far away.

But in Paper server, chunks will immediately unload when real players teleport far away.

Observed/Actual behavior

entity.touchingUnloadedChunk();

  • Always return true in Spigot server
  • Return false in Paper server when real player leave.

/paper entity list minecraft:player

  • Ticking when real players together with fake player
  • Non-ticking when rea...
rustic folioBOT
#
[PaperMC/Paper] branch deleted: dev/1.20.2
#
[PaperMC/Paper] New tag created: 1.20.1
#
[PaperMC/Paper] New tag created: 1.20
rustic folioBOT
#

Expected behavior

When Player#hideEntity(Plugin, Entity) is called, the passed entity should be hidden to the player.

Observed/Actual behavior

Nothing happens with no errors in console.

Steps/models to reproduce

//All given values are not null

ArmorStand armorStand = (ArmorStand) location.getWorld().spawnEntity(location, EntityType.ARMOR_STAND);
entityUUID = armorStand.getUniqueId();
armorStand.setInvisible(true);
armorStand.setInvulnerable(true);
armorStand.setGr...
rustic folioBOT
#

Fix the UnsupportedOperationException thrown in UnsafeValues#loadAdvancement

TestPlugin.java

package io.papermc.testplugin;

import org.bukkit.NamespacedKey;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

public final class TestPlugin extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        this.getServer().getPluginManager().registerEvents(this, this);
        this.getServer().getUnsafe().loadAdvancemen...
rustic folioBOT
#

Stack trace

java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Multiple entries with same key: LootItemConditionRandomChance[probability=0.25]=poke:effect_checking/movechance and LootItemConditionRandomChance[probability=0.25]=golem:random_lc
	at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?]
	at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073) ~[?:?]
	at net.minecraft.server.Main.main(Main.java...
rustic folioBOT
rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: fix-tests
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: meta/update-wiki
rustic folioBOT
#

Expected behavior

The JD for the block place event says Called when a block is placed by a player., so either for the event to not fire there or for the JD to be clarified.

Observed/Actual behavior

Whenever you place a book into a Lectern, a block place event is fired.

Steps/models to reproduce

This is using the Debuggery plugin (which is part of Paper's org), let me know if proper Java code is preferred.

  • /devent org.bukkit.event.block.BlockPlaceEvent
  • Right click ...
#
[PaperMC/Paper] branch deleted: fix/update-wiki
#
[PaperMC/Paper] branch deleted: fix-tests
rustic folioBOT
#

Expected behavior

no crash (it worked in 1.20.1)

Observed/Actual behavior

crash: https://cpaste.de/uxababimog.properties

Steps/models to reproduce

have a server with multiverse or probably some other multiworld plugin and teleport the player in PlayerJoinEvent to another world

Plugin and Datapack List

No datapacks, Multiverse + some custom plugins

Paper version

This server is running Paper version git-Paper-"298c478" (MC: 1.20.2) (Implementing API version 1.20.2-R...