#paper

1 messages ยท Page 10 of 1

rustic folioBOT
#

supporting strings here as arguments makes the logic as complex as it was for snapshot server handling, as if we are on 1.20.4, it's harder to say if it is older than random 99w99a, the same difficulty when it was vice versa

I don't think plugins will keep support for multiple snapshots or very old snapshot versions even when paper will release dev builds for snapshots, and if they will keep support for one snapshot version, they have #is(String) method to check for it

#

Yea I agree it'll be complex down the line to support snapshots, the parsing logic and manifest comparisons will be a bit of work but I don't think it's worth locking us out of this method working for snapshot comparison.

Even without snapshot support, int varags for this is a less than ideal parameter as isAtLeast() would then be valid.

As said in the general review, we are not currently supporting snapshots and hence reducing this pr to release-only while keeping us open to one day add snapshot support would be the goal.

For this, I think parsing a string passed here should be fine with the restriction that this method only takes stringified release versions, e.g 1.20.6 but not 1.20.6-rc1/24w18a.

rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

Not every place has issues with a player profile with a name that is longer than 16 characters.
As an example, in the multiplayer screen, the player names displayed while hovering over the server's player count are completely fine, even while the text is more than 16 characters.

Describe the solution you'd like.

One of two possible options I can think of:

  • A createProfile variant that accepts a boolean to toggle the check on and off (createProfile(String, UUID, boolean).
    The risk here is, that plugin devs may use it wrongly (Where it could cause visual bugs and more)
  • A separate Player profile type for the player Samples list.
    The player profile is kind of overkill here because info such as skin data is redundant and not even sent to the player in the context of a server list ping (Why Mojang?), so a separate type with only the necessary info and without the check could work.
    Problem here is possible API ...
rustic folioBOT
rustic folioBOT
#

Diff can be reduced to the following. callEvent() returns a boolean, by looking into the docs you'll see that it does what you did in 3 statements.

+            if(new io.papermc.paper.event.player.PlayerBrushBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(this.getLevel(), this.getBlockPos()), item.asBukkitCopy()).callEvent()) {
rustic folioBOT
#

Expected behavior

Happy to see the Brigadier branch merged! I started experimenting with the migration of our command framework onto this, and found this issue when trying to register one of our self-referential commands.

The structure of the command is something like:

/root child <arg> -> child

much like how /execute in vanilla redirects to itself. This should be, to my knowledge, a valid registration.

See the detailed registration process in Steps to reproduce.

Observed/Actual behavior

The unwrapping of the command tree causes a StackOverflowError:
https://pastes.dev/g3qbF994ZR

Steps/models to reproduce

plugin.getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, event -> {
            var root = Commands.literal("root").executes((ctx) -> 1).build();
            var arg = Commands.literal("child").redirect(root);

            root.addChild(arg.build());

            event.registrar().register(root);
        });
``...
rustic folioBOT
rustic folioBOT
#

Expected behavior

  1. Connect to server
  2. Works

Observed/Actual behavior

  1. Connect to server
  2. Kicked

Steps/models to reproduce

  1. Use Paper
  2. Connect to server
  3. Kicked

Plugin and Datapack List

12.05 16:56:34 [Server] [INFO] Server Plugins (41):
12.05 16:56:34 [Server] [INFO] Paper Plugins:
12.05 16:56:34 [Server] [INFO] - EconomyShopGUI
12.05 16:56:34 [Server] [INFO] Bukkit Plugins:
12.05 16:56:34 [Server] [INFO] - AntiCombatLog, AntiVoidTPStyle, AuctionHouse, AxKills, Citizens, CombatWeaponryPlus, CraftEnhance, CrisTreeCapitator, *CustomNukes, DeathChest
12.05 16:56:34 [Server] [INFO] DiscordSRV, Essentials, EssentialsChat, *FarmProtect, floodgate, Geyser-Spigot, GeyserHacks, InventoryRollbackPlus, LibsDisguises, LuckPerms
12.05 16:56:34 [Server] [INFO] Maintenance, MeltItems, motdgg, NoteBlockAPI, ore-control, PlaceholderAPI, PlayerEconomy, PlayerWarps, ProtocolLib, QualityArmory
12.05 16:56:34 [Server] [INFO] Simple-Drugs, *SimpleSit, Simp...

#
12.05 16:55:07 [Server] [INFO] Caused by: io.netty.handler.codec.EncoderException: Empty ItemStack not allowed
12.05 16:55:07 [Server] [INFO] at net.minecraft.world.item.ItemStack$2.encode(ItemStack.java:214) ~[paper-1.20.6.jar:git-Paper-"812ccb9"]
12.05 16:55:07 [Server] [INFO] at net.minecraft.world.item.ItemStack$2.encode(ItemStack.java:201) ~[paper-1.20.6.jar:git-Paper-"812ccb9"]
12.05 16:55:07 [Server] [INFO] at net.minecraft.world.item.crafting.SmithingTransformRecipe$Serializer.toNetwork(SmithingTransformRecipe.java:137) ~[?:?]

Something on your server created an invalid recipe, that is also a relatively really old version of paper

rustic folioBOT
#

You could use this event as a more direct way for filtering entities
I feel like that event is already as direct as you need it to be
I could also imagine more features in this event in the future as configuring selection radius which you wouldn't want in EntityDamageByEntityEvent
Sure though i believe such a thing could be added to the LightningStrikeEvent or LightningStrike Entity. though you could also manually get the Entities in a specific area and damage them which gives you even more control over it.
Event for zombie checking for players which he could attack does not exist though there is more general event for this EntityTargetEvent
EntityTargetEvent is called when a Mob starts targeting a player not when he checks if they are in reach to attack

rustic folioBOT
#

You could use this event as a more direct way for filtering entities

I feel like that event is already as direct as you need it to be

I could also imagine more features in this event in the future as configuring selection radius which you wouldn't want in EntityDamageByEntityEvent

Sure though i believe such a thing could be added to the LightningStrikeEvent or LightningStrike Entity. though you could also manually get the Entities in a specific area and damage them which gives you even more control over it.

Event for zombie checking for players which he could attack does not exist though there is more general event for this EntityTargetEvent

EntityTargetEvent is called when a Mob starts targeting a player not when they check if they are in reach to attack

alright, well then this commit has no use and I can close this

#

I can't use the original test plugin, since the changes made by #8235 are currently incompatible with the CommandAPI (https://github.com/JorelAli/CommandAPI/issues/554).

However, using #8235's API like so:

@Override
public void onEnable() {
    getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, event -> {
        event.registrar().register(
                Commands.literal("test")
                        .executes(context -> {
                            throw new SimpleCommandExceptionType(() -> "Custom exception message").create();
                        })
                        .build()
        );
    });
}

I am able to see the exception in the console

Exception

and it looks to work the same as with the client

Client exception

rustic folioBOT
rustic folioBOT
#

Well, this can be reopened anytime, incase someone would really want this. Reason why I firstly made it, was I didn't get any idea how could I get entities which were struck by the lightning and in the lightningstrikeevent it wasn't contained, it had not occured me to use EntityDamageByEntityEvent, so I made this event where then lynx said normal events could be used instead, though I still saw some future potentional this event could have.

rustic folioBOT
#

Expected behavior

When you get a MerchantRecipe from a villager and call one of the setters on it, either they should not be reflected without setting back the recipe to the villager, or all of the setters should be reflected. In other words, it should be consistent one way or another.

Observed/Actual behavior

Some of the setters mutate the actual nms MerchantOffer, while others only take effect after a "refresh" of the trades by actually making a trade.

Steps/models to reproduce

Use the code below in a test plugin


@EventHandler
public void onEvent(PlayerChatEvent event) {
    final Location loc = event.getPlayer().getTargetBlockExact(5).getLocation();
    final Villager villager = event.getPlayer().getWorld().spawn(loc.toCenterLocation().add(0, 1.5, 0), Villager.class);
    villager.setProfession(Villager.Profession.CLERIC);
    final MerchantRecipe recipe = new MerchantRecipe(new ItemStack(Material.DIAMOND, 64), 0, 100, false);
    recipe.addIngr...
rustic folioBOT
#

So one solution would be a method on the ping event to create "fake" profiles. Some implementation of PlayerProfile that was just a holder for a string name and uuid. It would have to clear that this is only valid in this event, hence a method on the event to create them. They could throw for all the property stuff. One downside is future listeners to the same event might expect full profiles and check properties for some reason

#

This is probably going to be the best middle ground which works best for people supporting 20 dozen different versions, not that that is exactly our concern; We can probably generally guard against people using these profiles elsewhere, or look towards dynamically converting if we for some reason ever wanted to deal with that

#

I feel like despite what CB's comment says about being unable to call the click event, we could call it by just mimicking some of the checks in the case QUICK_CRAFT.

int currentStatus = this.player.containerMenu.quickcraftStatus;
int newStatus = AbstractContainerMenu.getQuickcraftHeader(packet.getButtonNum());
if ((currentStatus != 1 || newStatus != 2 && currentStatus != newStatus)) {
} else if (this.player.containerMenu.getCarried().isEmpty()) {
} else if (newStatus == 0) {
} else if (newStatus == 1) {
} else if (newStatus == 2) {
    if (!this.player.containerMenu.quickcraftSlots.isEmpty()) {
        if (this.player.containerMenu.quickcraftSlots.size() == 1) {
            // fire "click" event
        }
    }
}

Just put this right before the call to AbstractContainerMenu#clicked

rustic folioBOT
#

Expected behavior

When cancelling a PlayerInteractionEvent caused by an opped player in creative mode interacting with a Jigsaw block, one would expect the Jigsaw block GUI to not open on the player client's screen, as the event was cancelled.

Observed/Actual behavior

Instead, when the PlayerInteractionEvent related to the player (in creative mode) interacting with the jigsaw block is cancelled, the Jigsaw block's interface is still opened on the client. This is completely abnormal from what is expected when a PlayerInteractEvent is cancelled. For example:

  • When a PlayerInteractEvent relating to a player opening a furance is cancelled, the client does not open the furnace GUI
  • When a PlayerInteractEvent relating to a player opening a chest is cancelled, the client does not open the chest GUI
  • When a PlayerInteractEvent relating to a (creative mode) player opening a command block is cancelled, the client does not open the command block GUI

Steps/models to repr...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: feature/datapack-lifecycle-event
rustic folioBOT
rustic folioBOT
#

I think this is "works as intended" due to the documentation on Inventory#getStorageContents. The javadocs for that method say

In most cases this will represent the entire inventory, but in some cases it may exclude armor or result slots.

and continues

It is these contents which will be used for add / contains / remove methods which look for a specific stack

I think that second part includes the #all method you mention here, as its looking for a specific stack. And it's right, all the other methods only operate on the "storage contents".

#

Yeah, I suppose we can address this. Is there functionally any difference from your end between doing this and cancelling the event?

Cancelling the event prevents the player from reeling the rod in, requiring them to swap to another item first before being able to re-cast the rod.

Unhooking the entity allows the rod to reel and be re-cast without switching items which is useful for preventing rod pulling entities.

rustic folioBOT
#

Expected behavior

Libraries loaded calling addURL(URL) on the plugin class loader (for example, using a library like Libby) should be remapped if the plugin is spigot-mapped.

Observed/Actual behavior

The classes of such libraries are not remapped. Consequently, the loaded libraries cannot access CraftBukkit or NMS classes.

Steps/models to reproduce

I've created a test plugin available at https://github.com/frengor/AddURLTest. Steps to reproduce are present in the README together with the already built plugin.

Plugin and Datapack List

None apart the plugin mentioned before.

Paper version

[05:38:14 INFO]: This server is running Paper version git-Paper-71 (MC: 1.20.6) (Implementing API version 1.20.6-R0.1-SNAPSHOT) (Git: 11c3963)
You are running the latest version
Previous version: git-Paper-64 (MC: 1.20.6)

Other

The test plugin correctly works on Spigot servers, but not on Paper servers.

This issue was...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

There's still an issue with the Preconditions.checkArgument(!result.isEmpty(), "Recipe cannot have an empty result.") check in the SmithingRecipe constructor failing for some vanilla recipes, which can be replicated by just going over them, e.g. getServer().recipeIterator().forEachRemaining(recipe -> getLogger().info("")).
Not super familiar with the recipe system, but from what I can see only SmithingTransformRecipes actually have a result, and SmithingTrimRecipes just pass in an air ItemStack which triggers that check (I.e. can probably just move the check into SmithingTransformRecipe?)

rustic folioBOT
#

EDIT 2: Haven't looked in detail but for what i want i need access to the dispenser BE that fired the projectile or spawned the tnt, not having it doesn't help me here.

The projectile source is on the Projectile entity with https://jd.papermc.io/paper/1.20.6/org/bukkit/projectiles/BlockProjectileSource.html.

Ok, took a look, I can use that for any projectile, but i still need something for the tnt being dispensed. I know of workarounds but using those is not an option. Guess I'll adjust my solution here and wait for the (probably unlikely) case that it will be merged. Otherwise I need to find a way to compile the jar on my own.

rustic folioBOT
#

Expected behavior

The ability to use Server.recipeIterator() to iterate over the recipes the server has

Observed/Actual behavior

[08:30:31 WARN]: [PaperTest] Task #2 for PaperTest v0.0.1 generated an exception
java.lang.IllegalArgumentException: Recipe cannot have an empty result.
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:143) ~[guava-32.1.2-jre.jar:?]
	at org.bukkit.inventory.SmithingRecipe.<init>(SmithingRecipe.java:47) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.inventory.SmithingTrimRecipe.<init>(SmithingTrimRecipe.java:37) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.inventory.CraftSmithingTrimRecipe.<init>(CraftSmithingTrimRecipe.java:17) ~[paper-1.20.6.jar:git-Paper-72]
	at net.minecraft.world.item.crafting.SmithingTrimRecipe.toBukkitRecipe(SmithingTrimRecipe.java:119) ~[paper-1.20.6.jar:git-Paper-72]
	at net.minecraft.world.item.crafting.RecipeHolder.toBukkitRecipe(RecipeHolder.java:15)...
rustic folioBOT
#

I am having a bit of trouble understanding what you mean exactly. but if i am interpreting your comment correctly that wouldn't work because we don't have access to the new Items that early in the stack. i should probably also mention that cb's comment is wrong (assuming we want to call InventoryDragEvent if the mouse is moved in just the same slot, this way we don't break the existing calls for InventoryDragEvent and this also allows plugins to check whether or not the single item was dragged into the slot or clicked which might be useful for some developers)

rustic folioBOT
#

There's still an issue with the Preconditions.checkArgument(!result.isEmpty(), "Recipe cannot have an empty result.")

Yeah, fixed that directly on master.

It did make me think about another possible error, and it turns out that upstream was just gonna insert null into RecipeChoice parameters in constructors if the nms Ingredient was empty. And that was gonna error. Now no vanilla recipes do that, but recipes added via datapacks surely could. So I've updated this PR to correctly handle converting an nms Ingredient back into an empty RecipeChoice. I also added a test that just runs the conversion for all recipes on the server which should catch changes like this in the future.

rustic folioBOT
#

Is your feature request related to a problem?

From time to time, we use volatile entities, which are not intended to remain on the server even after a reboot. (Display Text, etc...)
It can also be useful for server crashes to no longer have this object persistent.

Describe the solution you'd like.

I propose to create an option in the entity allowing or not to deactivate its backup in the world.
entity.setVolatile(true)

Describe alternatives you've considered.

No real idea of alternation

Other

No response

rustic folioBOT
rustic folioBOT
#

The problem with using the libraryLoader class loader is that it is present (i.e. not null) only if the plugin declares libraries in its plugin.yml, however plugins using Libby usually don't declare any. On top of that, when using Libby in a library you have no control on libraries declared by the plugins which will depend on you.

From LibraryLoader.createLoader(PluginDescriptionFile desc):

if ( desc.getLibraries().isEmpty() )
{
    return null;
}

Could always initializing the libraryLoader field to a non-null class loader be enough? (in which case I could make a PR)

rustic folioBOT
#

Expected behavior

No matter how an inventory is created, it should behave identical regarding methods like isEmpty. For example, setting the result slot in an anvil should always cause isEmpty on that inventory to return false.

Observed/Actual behavior

Depending on how the inventory was created, these methods behave differently. Inventories that were created using open... (e.g. openAnvil) create an instance of CraftInventoryAnvil. This class (and every other subclass of CraftResultInventory) do not override getContents or getStorageContents and therefore isEmpty in CraftInventory do not work properly. Inventories that were created using createInventory always create inventories of type CraftCustomInventory which holds a single container for all slots in the inventory and does not hold a container specifically for the result. Therefore isEmpty checks all slots, including the result slot.

Steps/models to reproduce

Player player = B...
rustic folioBOT
rustic folioBOT
#

I don't think we should change what getStorageContents returns for these "result" inventories. I think the javadocs of getStorageContents suggest that it shouldn't include result slots which often have special restrictions on placing items there. We can make getContents return all the slots tho.

None of this should affect how player inventories work to be clear, so the #all method in that case still isn't going to check armor/offhand.

#

But it already has inconsistencies built within. I made a comment here explaining them. In the current state getStorageContents is not consistent within different inventories. For CraftInventoryCrafting, which is an inventory with a result slot, it is handled accordingly and getStorageContents returns the entire inventory, including the result slot. For CraftFurnace, which has a result slot, getStorageContents returns the entire inventory as well, because despite having a result slot, it has no own result container internally.

Honestly it seems like the overriding of CraftInventory methods in the CraftInventoryCrafting should be moved into the CraftResultInventory class and CraftInventoryCrafting should extend CraftResultInventory. Furthermore, every other inventory with a result slot that does not already extend CraftResultInventory should do so. Because otherwise I'm not really sure how this should be...

#

The entire issue here is that the inventory you create with createInventory is a CraftCustomInventory which has 0 understanding or representation of the underlying inventory in use here. Combine that with the fact that the inventory API is generally in a weird state of rot and hot potato, and it's created the situation where the contracts of various parts of the API are somewhat unclear, especially as you can fairly easily spend all day debating on if "it says X" means that you include Y,Z into specific methods

rustic folioBOT
rustic folioBOT
#

We can't just make furnance inventories use CraftResultInventory. CraftResultInventory is for an inventory that is made up of 2 contains. Furnaces aren't, its just one container (the BaseContainerBlockEntity itself). We can however introduce logic to exclude it's result slot in the same way that CraftResultInventory does. I think that will provide the most consistency. result slots and player extras won't be included in getStorageContents

rustic folioBOT
rustic folioBOT
#

So my thinking here, was any inventory that had result slots that wasn't already using CraftResultInventory should have their "storage" contents exclude the result slots. The ones I found were villager trading inventories, all the furnaces, brewing stands, and crafting inventories.

I also fixed an issue where Inventories that were CraftResultInventories didn't include all the contents in getContents.


Fixes https://github.com/PaperMC/Paper/issues/10720

#
[PaperMC/Paper] New branch created: feature/bibliothek
rustic folioBOT
rustic folioBOT
#

Stack trace

[10:55:33 ERROR]: Error occurred while enabling SkyEleo v0.9-BETA (Is it up to date?)
org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.block.BlockEvent. Static getHandlerList method required!

Plugin and Datapack List

Using my own plugin with a test debug of BlockPistonEvent

Actions to reproduce (if known)

1- Use BlockPistonEvent
2- Compile
3- Get this error

Paper version

This server is running Paper version git-Paper-496 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 7ac24a1 on ver/1.20.4)
You are running the latest version
Previous version: git-Paper-493 (MC: 1.20.4)

Other

After checking the BlockPistonEvent inside Paper, it seems no handlers list method are there. Meaning we can't listen to the event as the required method getHandlerList isn't coded in.

#

@Machine-Maker This partly fixes the issue. The isEmpty check works as the documentation describes it. However, there are still inconsistencies between inventories created from createInventory and open....

Bukkit.getScheduler().runTaskLater(this, () -> {
    System.out.println(Arrays.toString(anvilInv.getContents())); // [null, null, stone]
    System.out.println(Arrays.toString(anvilInv.getStorageContents())); // [null, null, stone]
    player.closeInventory();

    InventoryView view = player.openAnvil(player.getLocation(), true);
    view.getTopInventory().setItem(2, new ItemStack(Material.STONE));

    Bukkit.getScheduler().runTaskLater(this, () -> {
        System.out.println(Arrays.toString(view.getTopInventory().getContents())); // [null, null, stone]
        System.out.println(Arrays.toString(view.getTopInventory().getStorageContents())); // [null, null]
    }, 2L);
}, 2L);

The storage contents don't match between these two inventories. As @...

#

This inconsistency seems to occur for all inventories that have a result slot, but don't have their own converter implementation in CraftInventoryCreator. For example, creating a furnace via createInventory creates an instance of CraftInventoryFurnace because a custom converter is applied that delegates to CraftInventoryFurnace. In this case everything works as expected (because they are from the same class).

Player player = Bukkit.getOnlinePlayers().stream().findAny().get();
Inventory furnaceInv = Bukkit.createInventory(null, InventoryType.FURNACE);
furnaceInv.setItem(2, new ItemStack(Material.STONE));
player.openInventory(furnaceInv);

Bukkit.getScheduler().runTaskLater(this, () -> {
    System.out.println(Arrays.toString(furnaceInv.getContents())); // [null, null, stone]
    System.out.println(Arrays.toString(furnaceInv.getStorageContents())); // [null, null]
    player.closeInventory();
}

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

oh welp, i opened this pr because yesterday someone on the discord was complaining they had to use nms to set the item and emily said she would open an issue (i guess she saw that method later aswell since she didn't open the issue yet) so after i couldn't find a method for it on the Inventory i just took their word for it and opened the pr lol. well ima close this then

rustic folioBOT
#

When there are no libraries declared in the plugin.yml of a plugin, the PluginClassLoader.libraryLoader field is initialized to a null value. Since it's marked as final, it's impossible to use the library loader (via reflection, for example using a library like Libby) in such case.

This PR fixes this by making LibraryLoader.createLoader(PluginDescriptionFile) always return a non-null class loader.

Also see https://github.com/PaperMC/Paper/issues/10713#issuecomment-2108086463

rustic folioBOT
rustic folioBOT
#

This PR doesn't add any public API, it just makes it possible for libraries like Libby (of which I am a maintainer) to keep working.

The issue arises when loading spigot mapped libraries using Libby, since they don't get automatically remapped with the method we're using (see https://github.com/PaperMC/Paper/issues/10713). As suggested in https://github.com/PaperMC/Paper/issues/10713#issuecomment-2107380684, applying the remapping manually and then using the libraryLoader to load the additional libraries fixes the issues. It's just that the libraryLoader is usually set to null, and since it's marked as final we can't do anything about that from Libby.

rustic folioBOT
#

Exposes the InteractionResult API to Paper. Allows certain events to create "overrides" for the returned InteractionResult where the event is called. Allows plugin devs to use a more specific approach to handling the return value of the event without directly canceling it.

The enum InteractionResult in io.papermc.paper.world.interaction.InteractionResult has the following Enum Values:

  • SUCCESS
  • SUCCESS_NO_ITEM_USED
  • CONSUME
  • CONSUME_PARTIAL
  • PASS
  • FAIL

The override of the InteractionResult will only occur when the event isn't canceled. Getters inside the events modified return null for when no override is present.

rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: feature/better-version
rustic folioBOT
rustic folioBOT
#

Expected behavior

Chunks should save (maybe by removing invalid characters from head profiles) or creating invalid head profiles should be prevented by the api.

Observed/Actual behavior

Invalid profiles can be created but chunks that contain entites with itemstacks with invalid profiles don't save at all. Paper sends a "Failed to save entity data (8,-6) in world 'freebuild'" message in the logs, but no stack trace, so i patched paper to add a stack trace there:

[00:43:39] [Server thread/ERROR]: [NewChunkHolder] Failed to save entity data (8,-6) in world 'freebuild'
net.minecraft.ReportedException: Saving entity NBT
at net.minecraft.world.entity.Entity.saveWithoutId(Entity.java:2570) ~[paper-1.20.6.jar:git-Paper-"3fc9358"]
at net.minecraft.world.entity.Entity.saveAsPassenger(Entity.java:2388) ~[paper-1.20.6.jar:git-Paper-"3fc9358"]
at net.minecraft.world.entity.Entity.saveAsPassenger(Entity.java:2374) ~[paper-1.20.6.jar:git-Paper-"3fc9358"]
...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Hey @masmc05! Thanks for your work on this pull request! โค๏ธ We've merged (most) of your work into #10729 where we've done some other changes related to versioning, and we'll be continuing this pull request over there. Feel free to comment over there.

Note: there are some minor differences, and there are one or two methods missing in #10729 currently.

rustic folioBOT
#

Hey @masmc05! Thanks for your work on this pull request! โค๏ธ We've merged (most) of your work into #10729 where we've done some other changes related to versioning, and we'll be continuing this pull request over there. Feel free to comment over there.

Note: there are some minor differences, and there are one or two methods missing in #10729 currently.

Yeah, I noticed, I'm glad that my work was able to help creating an even bigger addition to paper.
Will soon then try to get my second pr to be my first merged pr, as Amaranth suggested on Discord, with a change smaller than this (not something like world generator api v2)

rustic folioBOT
rustic folioBOT
#

I think all of those things are fixed, or will be fixed when I continue to work on the linked PR (#7265)

Hello, for some reasons, i still get weird behavior by creating a custom anvil inventory.
First of all, as you can see in the video below, the result item doesn't appear, or appear for a very quick time. But only when i try to rename the item, it appear normally.

Also, when opening a custom anvil, the inventory cannot be cast as an AnvilInventory, so it don't trigger PrepareAnvilEvent.

Test code i used for my tests:

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
        if(sender instanceof Player p){
            Inventory inv = Bukkit.createInventory(p, InventoryType.ANVIL, Component.text("Test Custom Anvil"));
            p.openInventory(inv);
        }
        return true;
    }

    @EventHandler
    public void onInventoryClick(InventoryClickEvent e){
...
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Modifying the result/return value of those methods allows to define what happens to the item and/or entity, and the client. For example:

Overriding the InteractionResult with the new API to SUCCESS would make it so the client swings its arm, instead of SUCCESS_NO_ITEM_USED which would still return a success but without swinging the arm. PASS would make it do nothing, FAIL would make it cancel whatever it's doing, etc. Its basically to add more detail to the interaction-based events. CONSUME iirc consumes the entire stack, and CONSUME_PARTIAL will only consume 1 of the item(if the stack has a higher amt value of 1).

rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] branch deleted: feature/better-version
rustic folioBOT
#

@fhnaumann yeah, the issue about create... vs open... is really a whole separate thing. I have an open PR that kinda tries to do something about it. It's the same cause that makes anvils not work with create.... I did recently have another idea for a better way to address that issue that I'll try to work on here. It's baby steps to make this inventory mess acceptable. Not gonna all happen in one PR.

rustic folioBOT
rustic folioBOT
#

Partially replaces https://github.com/PaperMC/Paper/pull/7265. That PR still has some stuff that this PR won't address.


While this might seem invasive, the pattern is very straightforward and easy to implement across all "result" type inventories. The worst part about it is the "mirroring" of the NonNullList that is initially created to hold the stacks. We have to use the exact same list for every Menu created so that the container is shared across multiple menus. We don't want to replace the Container instances on each Menu, because each Container instance created there has special logic specific to that menu, so instead we pass in the list of itemstacks from the created inventory.

- [ ] Smithing
- [ ] Cartography
- [ ] Stonecutter
- [ ] Anvil
- [ ] Loom
- [ ] Grindstone
- [ ] Crafter
#

So I did start up on https://github.com/PaperMC/Paper/pull/10732, which is my new idea for handling this. Some basic testing with the 2 inventory types I implemented seemed to suggest they function correctly (aka not randomly deleting items and actually letting you craft in them). With the other changes in the other PR, that should fix both issues (for result inventories). There are still other issues with non-result inventories.

rustic folioBOT
#

Expected behavior

Mob Spawner should spawn entities.

Observed/Actual behavior

Mob Spawner never spawns entities at all.

Steps/models to reproduce

Get a Mob Spawner
Place an egg in it
And it never spawns

Plugin and Datapack List

ViaVersion
ViaBackwards
ViaRewind
Geyser
Floodgate
Chunky
CoreProtect
WorldEdit
Chunky
CoreProtect
GriefPrevention
SkinRestorer

Paper version

/version
[09:53:30 INFO]: Unknown command. Type "/help" for help.
version
[09:53:34 INFO]: Checking version, please wait...
[09:53:36 INFO]: This server is running Paper version git-Paper-496 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 7ac24a1 on ver/1.20.4)
You are running the latest version

Other

It functions correctly on a singleplayer world.

#

Can you please provide a copy of your latest.log? Just upload it to a paste service and share it here.

I just tried on the build you're on with fresh configs (Bukkit.yml, Spigot.yml, & Paper's configs) and I had no issue placing a spawner, then an egg inside the spawner.

Just check your server difficulty too, if it's on Peaceful it won't spawn hostile mobs from spawners. If that isn't the issue, I'd recommend regenerating your config files to test. To do this stop your server, back them up (just make a local copy of them), and delete said files. Start your server again and it will be with default configs.

rustic folioBOT
#

Does this have to do with the mob spawner being submerged? Regenerating configs didn't change a thing.

Well it depends what mob you're putting in there. It will work underwater if there's enough room and the mob is an aquatic mob.
I'll close this issue now as I'm unable to reproduce it on a fresh server with no plugins.

If you have issues similar to this in the future you can try asking on our Discord first in #paper-help, but I note you're using SkinRestorer, offline mode ("cracked servers") won't be given support.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

I just tested it. Shields, shulker_boxes, chests and potions appear to be fixed. Bee_nests, beehives and decorated_pots (and possibly other items) still gain some additional data after interacting with them:

/give @p minecraft:bee_nest[minecraft:attribute_modifiers={show_in_tooltip:0b,modifiers:[]}]
bee_nest, beehive: receive block_entity_data:{id:bee_nest/hive,Bukkit.MaxEntities:3}

/give @p minecraft:decorated_pot[minecraft:attribute_modifiers={show_in_tooltip:0b,modifiers:[]}]
decorated_pot: receives container:[]

So at least bee_nests and beehives don't get the empty bees list and decorated_pots don't get the default pot_decorations list anymore, which happened without this fix.

This of course is a really unusual use case, because who would even put empty attribute lists on beehives or decorated pots. But yeah, items probably still shouldn't change their data after interacting with them, even if the data is very weird.

#

A new (maybe unreleated) issue with changing data I just found: A lodestone compass with empty lodestone_tracker={} loses this component after interacting with the item.
This can happen in vanilla after breaking the lodestone of the compass. Or you can use this command /give @p minecraft:compass[minecraft:lodestone_tracker={}]. Pick this item up, place it again and the enchantment glint disappears. In vanilla, the compass stays a lodestone compass.

rustic folioBOT
rustic folioBOT
#

The suppressCancellation functionality here isn't used almost anywhere, especially in teleportation despite the patch title. However it will be once the re-work of internal teleportation logic is done. This fixes an issue in that patch where the original OBFHELPER name selected for the overloads turned out to conflict with a mojang named method so the overrides where almost linked together in such a way to cause a StackOverflow. I don't think there was a possibility of one, but this removes all chance.

rustic folioBOT
#

Is your feature request related to a problem?

I recently tuned my Paper server very carefully using an up to date (1.20) guide. I was able to get great performance overall, but I and my players were super disappointed that one of the biggest recommendations was disabling treasure maps, a big blow to game experience.

Describe the solution you'd like.

Maybe it's just a pie in the sky and not really possible. But I would love to hear news that actually there's some other less impactful alternative to avoiding lag in my case, or that moving the map generation off the main server thread is possible. <3

Describe alternatives you've considered.

Using the Plan plugin to measure performance over the last 30 days, I have determined that I must choose one of the three to avoid significant lag:

  1. Greatly reduce view distance (currently at 8, on a server all about flying around with elytras).
  2. Cap players at 20 (we would otherwise hit 30+ several times per week).
  3. Disa...
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

/give @p minecraft:decorated_pot[minecraft:attribute_modifiers={show_in_tooltip:0b,modifiers:[]}]

While it shows up more in Paper, I think this is actually a vanilla issue. I opened an issue on the mojira and hopefully they pick it up. Not super great for us to fix it.

I pushed a fix for the bee_nest issue, and a separate PR for the compass stuff (since it's a little more involved).

rustic folioBOT
#

Stack trace

[15:36:39 ERROR]: Packet encoding of packet ID 85 threw (skippable? false)
java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.objects.ObjectArrayList.get(int)" because "this.wrapped" is null
at it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap$MapIterator.nextEntry(Object2ObjectOpenHashMap.java:631) ~[fastutil-8.5.9.jar:?]
at it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap$FastEntryIterator.next(Object2ObjectOpenHashMap.java:746) ~[fastutil-8.5.9.jar:?]
at it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap$FastEntryIterator.next(Object2ObjectOpenHashMap.java:741) ~[fastutil-8.5.9.jar:?]
at net.minecraft.nbt.CompoundTag.copy(CompoundTag.java:472) ~[?:?]
at net.minecraft.world.item.ItemStack.copy(ItemStack.java:740) ~[purpur-1.19.4.jar:git-Purpur-1985]
at net.minecraft.world.item.ItemStack.copy(ItemStack.java:728) ~[purpur-1.19.4.jar:git-Purpur-1985]
at net.minecraft.netw...

#

ไฝ ๆ—ขไธๆ˜ฏ้‹่กŒๆ–‡ไปถ๏ผŒไนŸไธๆ˜ฏๆ”ฏๆด็š„็‰ˆๆœฌใ€‚

ๅพž่กจ้ขไธŠ็œ‹๏ผŒ้€™ๅฏ่ƒฝๆ˜ฏ็”ฑๆ’ไปถไฟฎๆ”น็ทš็จ‹็‹€ๆ…‹ๅผ•่ตท็š„๏ผŒไฝ†ไธ่ƒฝไฟ่ญ‰ใ€‚

ๅฐ‡ๅ…ถ้—œ้–‰็‚บไธๆ”ฏๆดใ€‚

I don't know what is causing this, so how do I solve this problem and where do I start?

#

่ซ‹ๅƒ้–ฑhttps://docs.papermc.io/paper/basic-troubleshooting#find-the-culpritไบ†่งฃๅฆ‚ไฝ•้š”้›ขๅฏ่ƒฝๅฐŽ่‡ดๆญคๅ•้กŒ็š„ๆ’ไปถใ€‚

ๅŒๆจฃ๏ผŒๆ‚จ้‹่กŒ็š„ไธๆ˜ฏๅ—ๆ”ฏๆด็š„็‰ˆๆœฌ๏ผŒๆ‚จ้œ€่ฆ่‡ช่กŒไฟฎๅพฉๆญคๅ•้กŒใ€‚

Does the unsupported version refer to "plug-in", "paper" or "purpur"?

rustic folioBOT
rustic folioBOT
#

Stack trace

https://paste.gg/p/anonymous/892c48ad5fa7434d950d7a3a5932321c



### Plugin and Datapack List


.jar
4.12 MB
Apr 28th, 2024 1:41PM
Advanced-Portals-0.9.2.jar
120.01 kB
May 6th, 2024 8:37PM
AdvancedAFK-2.0-18 (1).jar
38.19 kB
May 6th, 2024 8:37PM
AdvancedVanish (11).jar
517.41 kB
May 6th, 2024 8:38PM
ajLeaderboards-2.8.0.jar
2.08 MB
May 6th, 2024 8:38PM
AlonsoTags-v2.2.1-BETA.jar
418.33 kB
May 6th, 2024 8:38PM
AntiCheatReplay-2.7.11.jar
117.11 kB
May 6th, 2024 8:38PM
AntiPopup-7.3.jar
2.39 MB
May 6th, 2024 10:33PM
Arceon-0.4.2_1.16+.jar
493.66 kB
May 6th, 2024 10:33PM
ArmorStandTools.jar
120.84 kB
May 6th, 2024 8:38PM
AuxProtect-1.2.11.2.jar
480.64 kB
May 6th, 2024 10:33PM
BanFromClaim-1.6.6.jar
71.55 kB
May 5th, 2024 11:20PM
BattlePass-4.2.19.jar
1.33 MB
May 6th, 2024 10:34PM
BeastCore-1.3.jar
904.45 kB
May 6th, 2024 10:34PM
BeastWithdraw-2.31.jar
142.44 kB
May 6th, 2024 10:34PM
BetterShulkerBoxesRewritten-4.1.2.jar...
rustic folioBOT
rustic folioBOT
#

NPEs:

  • OminousBottleMeta#getAmplifier when ominous_bottle_amplifier data component is absent
  • TropicalFishBucketMeta when variant is null for almost all the color getter
  • AxolotlBucketMeta#getVariant when variant is null
  • ItemMeta#getAttributeModifiers(Attribute) when attribute modifiers is null

Codec/item validation:
This often kick the player holding the bad item instantly without saving the last data.

  • FoodComponent#addEffect with out of bound probability (outside 0-1)
  • the default food component created by Spigot (ItemMeta#getFood) is invalid since 'eat_seconds' cannot be equals to zero
  • ItemMeta#set(Max)Damage doesn't check the range

ItemMeta bad equality:
This breaks the contract of equals that say x.equals(y) == y.equals(x)

  • CraftMetaEntityTag (equals)
  • CraftMetaSpawnEgg (equals)
  • CraftItemMeta (hashCode) that handle the max damage as a simple boolean and not as an integer

Misc:

  • empty fireworks effect is cleared by the item meta conversion (f...
rustic folioBOT
rustic folioBOT
#

Expected behavior

Server should be able to send the resource pack without prompt message: the prompt method from ResourcePackRequest.Builder is nullable.

Observed/Actual behavior

A NullPointerException is raised in the console instead
Stacktrace : https://paste.gg/p/anonymous/a3b051e274f44bd88b52e57245ea8104

Steps/models to reproduce

Example resource pack
Copy this snippet in a test plugin:

try {
    URI uri = new URI("https://github.com/PaperMC/Paper/files/15358352/example_pack.zip");
    String hash = "e7c726200efca2f0f1f22eebe927ce28e4ac3082";
    UUID uuid = UUID.nameUUIDFromBytes(hash.getBytes());

    event.getPlayer().sendResourcePacks(ResourcePackRequest.resourcePackRequest().packs(
            ResourcePackInfo.resourcePackInfo(uuid, uri, hash))
            // .prompt(Comp...
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

https://youtu.be/Gnm6FX6RT9o

Shield stunning behavior in 1.20.4 Paper

You can hit again after the shield breaks instantly

Observed/Actual behavior

https://youtu.be/A0TMlDv_RVE

Shield stunning behavior in 1.20.6 Paper

Seems to be a delay between breaking the shield and when you are able to hit them again

Steps/models to reproduce

Get someone to hold up their shield and spam click them

Observe the difference between a Paper Server running 1.20.4 versus 1.20.6

Plugin and Datapack List

Included in the above videos

Paper version

Included in the above videos

Other

Resource for Stunning: https://www.youtube.com/watch?v=HRZDGVCrDh4

Although some may have issues with it.
It has become a crucial part of Minecraft 1.9+ PvP for the past several years, allowing for more fast-paced and tactical gameplay, due in fact that almost all PvP and Event servers use Paper or a variation of it.

I ask that this new behavior be rever...

rustic folioBOT
rustic folioBOT
#

Expected behavior

I'm trying to use goal API to remove/add them as it suits me.
For example:

  • remove look_at_player goal and save it to a variable
  • add it back in
  • remove it again
  • and so on

Observed/Actual behavior

After adding the goal back and removing it, it isn't removed.

Steps/models to reproduce

  1. Get a goal - Bukkit.getMobGoals().getGoal(mob, goalKey);
  2. Remove it - Bukkit.getMobGoals().removeGoal(mob, goal);
  3. Add it back - Bukkit.getMobGoals().addGoal(mob, 1, goal);
  4. Remove it again - Bukkit.getMobGoals().removeGoal(mob, goal);
  5. See that it hasn't been removed - Bukkit.getMobGoals().hasGoal(mob, goalKey);

Plugin and Datapack List

image

Paper version

> ver
[13:39:01 INFO]: Checking version, please wait...
[13:39:02 INFO]: This server is running Paper version 1.20.6-81-master@5a9afbe (2024-05-17T21:45:46Z) (Implementing...
rustic folioBOT
#

Expected behavior

Hide attributes flag should hide attributes

Observed/Actual behavior

Adding item flag for hide attributes still shows "when in main hand blah"

Steps/models to reproduce

itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES)

Worked perfectly in 1.20.4
weirdly enough, works perfectly with viaversion on 1.20.6 client, so not a client problem

Plugin and Datapack List

N/A

Paper version

This server is running Paper version 1.20.6-DEV-master@5a9afbe (2024-05-18T13:33:02Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)
You are running the latest version
Previous version: git-Paper-"4fd58a1" (MC: 1.20.6)

Other

No response

rustic folioBOT
#

Expected behavior

item duplicates just place an item in item frame and break it

Observed/Actual behavior

item duplicates just place an item in item frame and break it

Steps/models to reproduce

item duplicates just place an item in item frame and break it

Plugin and Datapack List

item duplicates just place an item in item frame and break it

Paper version

item duplicates just place an item in item frame and break it

Other

item duplicates just place an item in item frame and break it

rustic folioBOT
#

@EventHandler
public void onInteract(PlayerInteractEvent e){
if(e.getPlayer().getLocation().getWorld().getName().equalsIgnoreCase("world")) {
if (e.getPlayer().getInventory().getItemInMainHand() != null) {
if (e.getPlayer().getInventory().getItemInMainHand().hasItemMeta()) {
if (e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getLocalizedName().equals("settings.lobby")) {
e.getPlayer().openInventory(settings_inventory(e.getPlayer()));
e.setCancelled(true);
}
}
}
}

}
rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: fix/vanilla-goal-rereg
#

Can reproduce.

I personally would be very much in favour of adding a configuration option for this. I agree that its a relatively important PvP mechanic, and vanilla behaviour here is just plain worse - even if it likely was just a unintended side-effect of the (frankly pretty horrible) changes Craftbukkit does in the LivingEntity#damage methods.

However, such a configuration option would need to be PR'ed and maintained, which of course is work.

rustic folioBOT
#

Is your feature request related to a problem?

Brigadier API has been merged lately, however it's missing one important feature - CommandSyntaxExceptions with components.

Describe the solution you'd like.

Maybe something like ComponentMessage class?

Describe alternatives you've considered.

PaperAdventure#asVanilla which returns nms component that implements brigadier Message.

Other

No response

rustic folioBOT
rustic folioBOT
#

Can reproduce.

I personally would be very much in favour of adding a configuration option for this. I agree that its a relatively important PvP mechanic, and vanilla behaviour here is just plain worse - even if it likely was just a unintended side-effect of the (frankly pretty horrible) changes Craftbukkit does in the LivingEntity#damage methods.

However, such a configuration option would need to be PR'ed and maintained, which of course is work. Not entirely sure how viable it would be to restore the old behaviour with a plugin - its possible to set the invulnerability, and there is the PrePlayerAttackEntityEvent (Paper only) too.

Even though it may not be vanilla, stuns have been a major part in Minecraft PvP that the community has enjoyed, so I feel like it would be worth it to support a config option for this, unintended bugs can be features you know.

rustic folioBOT
#

Expected behavior

Joining the Server normaly, not getting an error

Observed/Actual behavior

When joining the server, getting an error and getting kicked.

Steps/models to reproduce

Create a Plugin with the following code for a custom ShapedRecipe:

` //Bundle recipe with normal leather
final ShapedRecipe bundleRecipe = new ShapedRecipe(new NamespacedKey(Main.getInstance(), "WinterCraftCoreBundle"), new ItemStack(Material.BUNDLE, 1));
bundleRecipe.shape("SLS", "LAL", "LLL");
bundleRecipe.setIngredient('S', Material.STRING);
bundleRecipe.setIngredient('L', Material.LEATHER);
bundleRecipe.setIngredient('A', Material.AIR);
//

    Main.getInstance().getServer().addRecipe(bundleRecipe);`

This Code worked prior to Paper 1.20.6.

Plugin and Datapack List

No datapacks, only my own plugin which adds the recipe above

Paper version

This server is running Paper version 1.20.6-82-master@0ad09de (20...

rustic folioBOT
#

I think you mis-understood what that PR does. It will continue to throw an error when you create a recipe, it will just do it earlier. air is no longer a valid ingredient. If we didn't add early error checking, you would instead get an error when a player joined and the server tried to send the recipe packet to the player.

That PR adds an "empty" recipe choice for very specific recipes that allow empty ingredients.

Ah ok.
And in the current API, can I even (and how?) create a recipe with empty slots?

#

I looked at the code and seems like this was always the supported method, which copied the vanilla, while adding air was just not prevented, which now adds restrictions

Also bukkit doesn't limit you to use only space as emptiness, unlike vanilla. Just as long as you don't define the char, it will mean emptiness, but space will ensure no future incompatibility, since it's the same as vanilla

rustic folioBOT
#

Expected behavior

SpigotMC fixed a bug in a recent commit, but PaperMC has not yet synchronized this fix. Wish PaperMC could sync up. Fixing the bug will affect some plugins to add knock back function to projectiles such as snowballs.

Commit of the bug:
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/2ea1e7ac2795f160ad7cdae1a7c21cc6c2bf4a32

Observed/Actual behavior

Preventing positivity.setDamage value from causing knockback for 0 damage events

Steps/models to reproduce

@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
    public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
         event.setDamage(Math.max(event.getDamage(), 1));
    }
}

In older versions, these codes can make snowball able to cause knock back.
But a wrong change disable this.
So this commit can solve this problem.

Plugin and Datapack List

In fact plugins and datapacks do not affect

pl
[00:31:01 ...

#

By the way, the penultimate line of code here should be changed to return originalDamage > 0.
This is because we still need to consider whether the original damage is >0.
LivingEntity.java Line2386

if (event.getDamage(DamageModifier.BLOCKING) < 0) {
if (this instanceof ServerPlayer) {
CriteriaTriggers.ENTITY_HURT_PLAYER.trigger((ServerPlayer) this, damagesource, originalDamage, f, true);  // Paper - fix taken/dealt param order
f2 = (float) -event.getDamage(DamageModifier.BLOCKING);
if (f2 > 0.0F &&f2 < 3.4028235E37F) {
awardStat(Stats.DAMAGE_BLOCKED_BY_SHIELD, Math.round(originalDamage * 10.0F)); ((ServerPlayer) this). Awardstat (stats.damage_blocked_by_Shield, Math.round(Originaldamage * 10.0f));
}
}

if (damagesource.getEntity() instanceof ServerPlayer) {
CriteriaTriggers.PLAYER_HURT_ENTITY.trigger((ServerPlayer) damagesource.getEntity(), this, damagesource,  originalDamage, f, true);  // Paper - fix taken/dealt param order
}

return true;
} else {
return ...
rustic folioBOT
#

The option to modify the behavior seems feasible. But I personally don't agree.
The reason for this is that version 1.20.4 and before that can produce this behavior is essentially a code bug on CraftBukkit. This bug not only causes shield disabled behavior to be abnormal, but also causes MC-147694 error to be called. This bug on CraftBukkit, together with MC-147694, produces the abnormal behavior of "Stunning", which also causes abnormal repel when shields are defending. (For example: When the victim takes magma damage while raising his shield and is subsequently attacked by another player, the victim is repelled forward)
MC-147694: https://bugs.mojang.com/browse/MC-147694

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

I've updated SectorTool to v1.1:

Add copy option for conversion to SectorFile

The copy option does not perform decompression/recompression,
which should make it faster for systems limited by CPU resources.

Additionally, read the entire RegionFile into memory when converting
to SectorFile to avoid random read costs when converting.

I will be adding in code to convert RegionFiles on the fly as well.

rustic folioBOT
rustic folioBOT
#

Expected behavior

Ruined portal chests should have random loot inside.

Observed/Actual behavior

When a ruined portal chest is underwater, it doesn't generate loot.

Steps/models to reproduce

Install paper 1.20.4, generate new chunks with ruined nether portal that has an underwater chest, open chest to see it is empty.

Plugin and Datapack List

There are 2 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)]
Server Plugins (0):

Paper version

This server is running Paper version git-Paper-496 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 7ac24a1 on ver/1.20.4)

Other

I checked to see if this behavior was present in spigot, or because of any plugins I had. The issue was only able to be reproduced in paper and purpur. Not sure if 1.20.4 is supported anymore. I tried my best to find a similar issue thread, but I am not adept at searching issues in github.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

No error on items and commands with minecraft tag
Example: minecraft:spruce_log / minecraft:tp

Observed/Actual behavior

Error, this when using minecraft: tagged item, error example is minecraft:spruce_log
For this error, I assume it's a minor error, because I still get the item

2024-05-20 21:51:41 mc-shockbyte  | java.lang.Throwable: com.mojang.brigadier.exceptions.CommandSyntaxException: Unknown item 'minecraft:' at position 0: <--[HERE]
2024-05-20 21:51:41 mc-shockbyte  |     at org.bukkit.craftbukkit.util.CraftMagicNumbers.modifyItemStack(CraftMagicNumbers.java:306) ~[paper-1.20.6.jar:1.20.6-85-7d2e5c3]
2024-05-20 21:51:41 mc-shockbyte  |     at EssentialsX-2.21.0-dev+81-cde7184.jar/com.earth2me.essentials.MetaItemStack.canSpawn(MetaItemStack.java:134) ~[EssentialsX-2.21.0-dev+81-cde7184.jar:?]
2024-05-20 21:51:41 mc-shockbyte  |...
rustic folioBOT
rustic folioBOT
#

Expected behavior

I am on paper 1.20.6 on the latests versions (not sure of which exactly) trying to create an HideAndSeek plugin.
For this purpose, I use an invisible armorstand where I put the block on its head.

However, it just disappears when looking higher or getting further, ...

Observed/Actual behavior

I really would like this bug to be fixed as fast as possible :)

Steps/models to reproduce

Not sure but create an invisible armorstand with no gravity where you put a block on its head and teleport it below the ground to make the block touch the ground.
Then go around it and it should disappear :(

Plugin and Datapack List

ArmorStandTools
FAWE

Paper version

1.20.6 (not access to the /version) probably around build 80+

Other

No response

rustic folioBOT
rustic folioBOT
#

It is not about the distance between you and the armorstand but just when you are looking, for example if you look above its head it disappear, it is just strange.

Also, I use falling block by default but I went to armorstand because you can remove the hitbox and edit attributes on it, which you can't do on falling block

rustic folioBOT
#

Is your feature request related to a problem?

Let's say you want to make a buch of custom entities. A way to do this is by exteinding LivingEntity, Mob or sth else with your own class and build an inheritance structure for your Entities and let the EntityType decideswhich Entity the Client should display.

This was easaly possible in earlier versions of Paper. But since a few versions the decision to rewrite the huge if statement in CraftEntity#getEntity into EntityTypeData happened.

   public static <T extends Entity> CraftEntity getEntity(CraftServer server, T entity) {
        Preconditions.checkArgument(entity != null, "Unknown entity");

        // Special case human, since bukkit use Player interface for ...
        if (entity instanceof net.minecraft.world.entity.player.Player && !(entity instanceof ServerPlayer)) {
            return new CraftHumanEntity(server, (net.minecraft.world.entity.player.Player) entity);
        }

        // Special case ...
rustic folioBOT
#

When the center of an entities bounding box is outside of the player's screen, the entire entity will not be rendered (culled). This is just client behaviour to optimise entity rendering. When you put an armor stand into the ground, the center of its bounding box will be low enough for it to not be rendered when looking straight ahead.

You should use display entities instead. They are not culled by default, and culling can be configured with the API and offer plenty of other advantages over armor stands, including not having a hitbox at all.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: print-warn-cre
rustic folioBOT
rustic folioBOT
#

I am unsure what the point of this is?
You will already need internals beyond this as you need to run jars loaded by libby through the io.papermc.paper.pluginremap.PluginRemapper to remap them.

At that point, what prevents you from using the io.papermc.paper.plugin.entrypoint.classloader.BytecodeModifyingURLClassLoader ?
Libby isn't currently injecting its libraries into the library classloader from what I am gathering (given it can be null), so what is the point in hijacking this instead of just creating a BytecodeModifiyingUCL ?

rustic folioBOT
#

At that point, what prevents you from using the io.papermc.paper.plugin.entrypoint.classloader.BytecodeModifyingURLClassLoader ?

The plugins using Libby need to access libraries loaded by Libby. This is possible only if the class loader of the plugin can resolve them, which is why Libby now calls addURL on it. Creating a new separate class loader isn't gonna work! It requires support from org.bukkit.plugin.java.PluginClassLoader (which already has special support for the libraryLoader).

The plan is to modify Libby to call addURL on the libraryLoader so that, if the plugin is spigot-mapped, library reflections will be remapped (since the libraryLoader will be an instance of BytecodeModifyingURLClassLoader). I know this isn't a perfect solution, but it is a minimal one.

A better solution would be to always have a BytecodeModifyingURLClassLoader in addition to the usual libraryLoader, even for mojang-mapped plugins, but I don't know if that would be preferr...

#

Ah fair, I thought it was completely injecting itself deeper, but yea if its just adding to #addUrl I guess I see the point.
I personally don't mind "hacking" the PluginClassLoader on that level, the spigot classloading system is already a hot mess.

I am unsure if we'd want to always initialise it or potentially leave it mutable, tho always init seems better imo so I would incline to approve the PR.

rustic folioBOT
#

I am unsure if we'd want to always initialise it or potentially leave it mutable

Leaving it mutable opens to more things from the Libby side, like implementing what I was talking before outside the server implementation (citing myself):

Actually, maybe a better compromise would be to have two separate libraryLoaders, one for mojang-mapped libraries and one for non-mojang-mapped ones

Always initializing the field is already enough though, so I don't really have a strong preference either.

rustic folioBOT
#

Is your feature request related to a problem?

Using the new Brigadier API, I would like to create a custom argument type that returns a direct player instead of a list with just one player in it. Unfortunately I'm unable to since PlayerSelectorArgumentResolver needs a CommandSourceStack to be resolved.

public class SinglePlayerArgumentType implements CustomArgumentType.Converted<Player, PlayerSelectorArgumentResolver> {

    @Override
    public @NotNull Player convert(@NotNull PlayerSelectorArgumentResolver playerSelectorArgumentResolver) throws CommandSyntaxException {
        return playerSelectorArgumentResolver.resolve(<commandSourceStack>);
    }

    @Override
    public @NotNull ArgumentType<PlayerSelectorArgumentResolver> getNativeType() {
        return ArgumentTypes.player();
    }

}

Describe the solution you'd like.

To extend the functionality of custom argument types it would come in handy to pass the current CommandSourceStack to the ...

#

This is a brigadier limitation. The current executor is not available when an argument type is being parsed. If you look at the brigadier ArgumentType interface, you will see that the parse method only takes a StringReader, and doesn't have any other context to parse. That is why a lot of the arguments have a "resolve" method because it later has to use the current executor to get the value of the argument.

rustic folioBOT
#
[PaperMC/Paper] New branch created: bukkit-pluginloader-api
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

When a cat riding in a minecart is placed ontop of a chest, players should be prevented from opening that chest.

Observed/Actual behavior

The chest Is still able to be opened, however this behavior is somewhat inconsistent. Sometimes opening the chest IS blocked, but this appears to only happen part of the time.

Steps/models to reproduce

  • Summon a cat
  • Tame the cat
  • Put it in a minecart
  • move that minecart on top of a chest
  • chest is able to be opened

Plugin and Datapack List

Plugins: Viabackwards, ViaVersion
Datapacks: Vanilla, Bukkit

Paper version

This server is running Paper version git-Paper-496 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 7ac24a1 on ver/1.20.4)
You are running the latest version

Other

No response

rustic folioBOT
#

Is your feature request related to a problem?

minecraft is a world famous game, as is the paper server, but the default image repository "repo.maven.apache.org" used by the built-in SpigotLibraryLoader is too delayed in many places to use

Describe the solution you'd like.

Custom maven image repository

Describe alternatives you've considered.

Provides a configuration item

Other

Thank you all for your hard work

rustic folioBOT
#

G'day LockeShor!

It's standard vanilla behaviour that a chest cannot be opened if a cat is sitting on the chest, you can open a chest if the cat is standing on the chest (whether in a minecart or not).

I have been unable to reproduce opening a chest whilst a cat is sitting on top of it (in a minecart or not). Are you able to provide a video of this happening, please? Also, make sure you are running no plugins (including ViaVersion/Backwards) when you test this again.

rustic folioBOT
#

While I see why this change is good for plugins which only support Paper, I also don't think this is going to be commonly used in Bukkit plugins, since usually Bukkit plugins wants to be compatible with Spigot and paper-plugin-loader works only on Paper.

Also, this doesn't solve https://github.com/PaperMC/Paper/pull/10726, since Libby doesn't require users to add a field to their plugin.yml and is supposed to work "out of the box".

rustic folioBOT
#

I agree with you that https://github.com/PaperMC/Paper/pull/10726 is not inherently an issue of Paper, however it is an issue for every user of Libby (of which I am a maintainer).

Don't get me wrong, I am in favor of this PR, my argument here it's just that this isn't an "alternative solution to https://github.com/PaperMC/Paper/pull/10726".

I'm not sure what the argument here is for botching internals to do something we already have API that we can expand the use case for.

I'll expand more on the use cases of Libby. It's possible to use Libby to manage dependencies in libraries which provide a shadeable version, not just plugins (or libraries distributed as plugins like ProtocolLib). For example, in UltimateAdvancementAPI we use Libby to download HikariCP only when MySQL is used (94% of users uses SQLite, so for them there is no need to download it). Also, Libby is used to download the correct version of [CommandAPI...

rustic folioBOT
rustic folioBOT
#

@masmc05
That would be good, however that's already possible to do using PluginInitializerManager.instance().pluginRemapper.remapLibraries(paths) (a method in unsafe would be better since its API, but calling the remapper is technically already possible). The part that's not currently possible is to remap reflections in loaded libraries (see https://github.com/PaperMC/Paper/pull/10726#issuecomment-2123187021).

rustic folioBOT
rustic folioBOT
#

While I see why this change is good for plugins which only support Paper, I also don't think this is going to be commonly used in Bukkit plugins, since usually Bukkit plugins wants to be compatible with Spigot and paper-plugin-loader works only on Paper.

Also, this doesn't solve #10726, since Libby doesn't require users to add a field to their plugin.yml and is supposed to work "out of the box".

You can continue to use the same hacks as always on spigot. This PR adds a supported API for configuring a Bukkit plugin's classpath on Paper. It does solve #10726 for every case that we intend to support.

rustic folioBOT
rustic folioBOT
#

Fixes https://github.com/PaperMC/Paper/issues/10750
Replaces https://github.com/PaperMC/Paper/pull/10375 which fixed https://github.com/PaperMC/Paper/issues/10022


This fixes the invalid block entities, not by removing them which the original fix did. that causes data loss as evidenced by the new issue this fixes relating to loot tables disappearing. The correct fix is to not mutate the WorldGenRegion's ProtoChunks when calling BlockGetter#getBlockEntity. Vanilla, if calling getBlockEntity on a block which doesn't have one and has a BlockState that should have one, cretes a BlockEntity and inserts it into the map (the mutation). Then if the block is later changed, the block entity and blockstate might not match. This isn't an issue in vanilla, because getBlockEntity is only caused in very specific places, but the BLockTransformer system was making it be called for every block in order to create a BlockState for the API. The fix is to just get a block entity as well as...

rustic folioBOT
#

Expected behavior

I expected to see no problems with importing the class and I didn't find any evidence as to they had removed the class completely.

Observed/Actual behavior

what I saw was that there was an error saying : cannot find symbol.
image

Steps/models to reproduce

Here is my code:
`package org.mukund.smp;

import org.bukkit.entity.LightningStrike;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;

public class EchestListener implements Listener {

@EventHandler
public void onInvClick(InventoryClickEvent event) {
    Inventory inv = event.getInventory();

    if (inv.getType() != ((Player)event.getWhoClicked()).getInventory().getType()) {
     ...
rustic folioBOT
rustic folioBOT
#

Expected behavior

When swapping two items between an inventory ("clicked" slot) and hotbar (either by pressing hotbar key 1-9 or offhand key), InventoryClickEvent#getAction should give action HOTBAR_SWAP according to the documentation.

I am unsure if this is a case where the documentation is incorrect (behaviour has always been this way) or the outcome is incorrect (documentation was correct in previous versions).

I am also unsure if this is the case on Spigot or CraftBukkit as my plugins are designed only for Paper currently.

Observed/Actual behavior

When both slots (hotbar and inventory slot clicked) have items in them, the action returned is HOTBAR_MOVE_AND_READD despite the actual behaviour being to swap the stacks.

When one slot is empty, the action returned is HOTBAR_SWAP which is correct.

When both slots are empty, the action returned is NOTHING which is correct.

Steps/models to reproduce

Listen for InventoryClickEvent
Swap items betwee...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

fixes #10151
The onRemove methods are often responsible for updating neighbouring blocks, which we don't want to update if BlockPlaceEvent is cancelled.

This doesn't only fix the example shown in the linked issue but also other issues regarding other redstone blocks like wires (there might be more just from looking at onRemove implementations on different redstone blocks, though i didn't test those).

rustic folioBOT
#

IRe-testing across latest Spigot 1.17.1, Paper 1.17.1 (last 1.17.1 build), Spigot 1.20.4, Paper 1.20.4 (last 1.20.4 build), latest Spigot 1.20.6, Paper 1.20.6-90 (current newest build) with a plugin dedicated to simply printing this action and no other plugins. The intention is to show any differences between old version (1.17.1), stable version (1.20.4) and latest version (1.20.6)

For clarity:

  • Tested in Survival mode
  • Tested with actual items in both slots (as no issue was observed with either or both empty)
  • Tested on Vanilla client, exact version (e.g 1.17.1 client for 1.17.1, not a different minor version)
  • Tested with only one plugin with sole function to print InventoryClickEvent#getAction on normal priority

Spigot 1.17.1 (latest)

  • Works correctly between any combination of Player Inventory, Offhand and Hotbar, both when opening PlayerInventory with E or in another inventory's bottom inventory
  • Shows the wrong result between Chest Inventory and Offhand | Che...
rustic folioBOT
#

Expected behavior

  • Shift-clicking item in player inventory moves as many as it can to hotbar, rest are left in inventory
  • No InventoryAction properly matches this description

HOTBAR_SWAP or HOTBAR_MOVE_AND_READD are the closest approximations but neither accurately describe this.

A different action like MOVE_TO_HOTBAR or MOVE_TO_INVENTORY would make sense here.

Observed/Actual behavior

Actual InventoryAction is MOVE_TO_OTHER_INVENTORY

Steps/models to reproduce

  • Shift-click item in player inventory (after opening with E, not in another inventory)
  • Item moves as many as it can to hotbar, rest are left in inventory
  • Listen for InventoryClickEvent
  • Log InventoryClickEvent#getAction

This also applies to any inventory which does not allow the item (e.g Chest in Brewing Stand) - it will move between inventory and hotbar, instead of into the inventory. The game does not attempt to move it into the inventory.

Plugin and Datapack List

No datapacks.
...

rustic folioBOT
#

Expected behavior

1.20.5 introduced new gamerule spawnChunkRadius that can manage how many of spawn chunks should be always loaded. When setting to 0, no spawn chunks should be loaded. This was marked as fixed on issue #10622 but still happens in latest build.

Observed/Actual behavior

Gamerule keeps resetting back to 2 after each server restart.

Steps/models to reproduce

  1. Set gamerule to different setting than 2 (i.e. /execute in minecraft:overworld run gamerule spawnChunkRadius 0 or /gamerule spawnChunkRadius 0
  2. Restart the server
  3. Check gamerule - it resets back to 2 (i.e. /execute in minecraft:overworld run gamerule spawnChunkRadius or /gamerule spawnChunkRadius

Plugin and Datapack List

[23:17:10 INFO]: Bukkit Plugins:
[23:17:10 INFO]: - antiRedstoneClock, ChestShop, Citizens, ClearLag, CMI, CMILib, DeluxeMenus, DeluxeTags, DropEdit2, Duels
[23:17:10 INFO]: Factions, FastAsyncWorldEdit, Funkcijos, IllegalStack, InteractionVisualizer, L...

rustic folioBOT
#

Expected behavior

When you give yourself a player head with the item component "profile", it should give you the player head with the skin of the indicated component value and the texture should stick with the given player head.

Observed/Actual behavior

The texture is visible in the inventory at first. But whenever you interact with it (place it on the ground, throw the item etc.), some of the player heads lose its skin texture and convert to one of the default skin textures. The issue occurs in some skins but the texture sticks properly for the other ones. I observed that which skins are sticking is inconsistent across my two servers.

Steps/models to reproduce

  1. Use a give command to get a player head with a profile component (for ex. /give @p minecraft:player_head[minecraft:profile="test"])
  2. When you get the skull, the skin should be visible.
  3. Throw the item on the ground, or place it.
  4. The correct skin disappears and converts to one of the default ski...
rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] branch deleted: bukkit-pluginloader-api
rustic folioBOT
rustic folioBOT
#

open said sign via the API would override the allowed editor

Correct, and is expected. Plugins should check whether there's already an editor if they want to avoid overrides.

so would the player interacting with it

I just checked, and other players can't interact with the sign (open it / dye) if there's an editor set, and said editor is within range.


Setting the allowed player softly "notifies" other plugins that this sign is occupied without the need to actually open the sign on the same tick, or at all (e.g. you might want to open chest menu instead, and on inventory close, set the editor back no null).

The other way to handle the given example would be to cancel all interact events while you handle your own sign editing, but in my case I do not want to cancel literally all interacts since not all interactions interfere with editor, and other plugins can't know who's occupying the sign.


You brought up a good point about the range reset, though. Whil...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

Server Icon not install
ะกะฝะธะผะพะบ ัะบั€ะฐะฝะฐ 2024-05-24 124051

Observed/Actual behavior

Steps/models to reproduce

Plugin and Datapack List

ะกะฝะธะผะพะบ ัะบั€ะฐะฝะฐ 2024-05-24 124235

Paper version

[09:43:10 INFO]: Checking version, please wait...
[09:43:10 INFO]: This server is running Paper version git-Paper-496 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 7ac24a1 on ver/1.20.4)
You are running the latest version

Other

ะกะฝะธะผะพะบ ัะบั€ะฐะฝะฐ 2024-05-24 124051

rustic folioBOT
rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] branch deleted: fix/vanilla-goal-rereg
rustic folioBOT
rustic folioBOT
#

Expected behavior

Allow plugins to create profiles with illegal characters

Observed/Actual behavior

Some plugins don't work as expected.

Steps/models to reproduce

I have a custom Resourcepack and I use some Chinese characters that translate to blocks/items/emojis on chat,
For example, the character ้œ‚ is equal to a bedrock block. I've defined this character as a prefix for floodgate players, but when some plugins try to load those bedrock players, StackTraces happens.

Plugin and Datapack List

AdvancedEnchantments, AdvancedJobs, ajLeaderboards, AngelChest, BetterRTP, BlueSlimeCore, BungeeGuard, Citizens, *Click2Enchant_Remake, CMI, CMILib, CoinsEngine, CommandPrompter, ConditionalEvents, DeluxeCombat, DeluxeMenus, DeluxeTags, DiscordBotImperioGames, DiscordSRV, DoorsReloaded, DragonSlayer, DragonTimer, eventosIG, ExcellentCrates, ExcellentShop, FartherViewDistance, floodgate, HeadDB, HolographicDisplays, ImageMaps, Insights, Lands, LibsDisguises, LimitPill...

#

I don't agree with the answer. By default tools and armors have attributes that can be overriden in ItemMeta. Preventing the attribute_modifiers.show_in_tooltip item component to be added because there is no custom attribute modifier is wrong.
See the issue on Spigot JIRA: https://hub.spigotmc.org/jira/browse/SPIGOT-7655
Shall I make another issue or will you reopen this one?

#

which is also garbage, Becasue now the itemstack itself has to track its default attribute modifiers instead of pulling it from the prototype.
That would just be screaming for items to end up with incorrect attribute modifiers down the line.

The real solution here is to kindly ask mojang for a way to decouple this, beyond that not much to do that isn'T going to break down the line.

#

Does it make sense to dynamically fetch this via e.g.

diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index c99311aa..c3b44cbb 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -221,8 +221,9 @@ public final class MapCursor {
      */
     @Deprecated(forRemoval = true, since = "1.20.2") // Paper
     public void setRawType(byte type) {
-        if (type < 0 || type > 26) {
-            throw new IllegalArgumentException("Type must be in the range 0-26");
+        class Bounds { public static final int UPPER_MAP_CURSOR_TYPE_BOUND = Type.values().length - 1; } // Paper
+        if (type < 0 || type > Bounds.UPPER_MAP_CURSOR_TYPE_BOUND) { // Paper
+            throw new IllegalArgumentException("Type must be in the range 0-" + Bounds.UPPER_MAP_CURSOR_TYPE_BOUND); // Paper
         }
         this.type = type;
     }
rustic folioBOT
rustic folioBOT
#

Right now, the only way to hide the tooltip of tools/weapons/armor is by adding a fake attribute modifier (i.e. on the GENERIC_ARMOR_TOUGHNESS attribute, put a 0 ADD_SCALAR attribute modifier) and then the ItemFlag.HIDE_ATTRIBUTES flag.

To be clear, when you do this, you are also removing any implicit modifiers that item type may have. If you do this to a tool, you are removing the attributes that would be default on that item type.

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

To be clear, when you do this, you are also removing any implicit modifiers that item type may have. If you do this to a tool, you are removing the attributes that would be default on that item type.
Okay thank you for the clarification, I didn't know it works like that.
Isn't it possible to fetch the "default" attributes for the items in the applyModifiers method and add the show_in_tooltip component to it?

#

Yea you could, but then you defined the default attributes specifically on the item stack, not the item (or material in the Bukkit world). This has the terrible side effect that any changes by Mojang or whoever down the line to the default attributes are no longer reflected.

If you copy the 1.20.6 default attributes of a diamond sword to apply them again but with show tooltip false, Mojang or a datapack change those values in a future version, now all of your created diamond swords are having wrong defaults and there is nothing paper can do about it.

rustic folioBOT
#

Is your feature request related to a problem?

BukkitBrigadierCommandSource is now deprecated and scheduled for removal. Although AsyncPlayerSendCommandsEvent isn't scheduled for removal or deprecated, I would assume it would fall with it.

I rely on this event since I have a system where players on the same server are separated into different games with different commands. Some commands may exist in both games, some don't. Some may have the same name as others but fully different arguments and functionality. Player#updateCommands() is used when switching games
Therefor, I cannot register these commands globally and instead append them in this event. They are then handled in the PlayerCommandPreprocessEvent.

Describe the solution you'd like.

A new event (or a breaking update to the current one) adapting the new interface (that is not deprecated or scheduled for removal) with the same functionality.

Describe alternatives you've considered.

Using protocol lib to m...

rustic folioBOT
#

Is this really a papermc scope?

I think it's kinda hard to say. For spigot it would definetly out of scope, but probably not for Paper.

Spawning an NPC with AI isnt as hard as it seems to be. Just two packages, add the Entity to the World, implement a few Controllers and done. You have your mob.

It would make sense, because developers can only do all this stuff without NMS. Expect the two packets you can do everything with CraftBukkit. And here is the problem. It is CraftBukkit not the API.

Another point is that Human Entities are become more and more important. And by implementing such an API into paper we would give them more stability.

I already have a working POC for this topic so I could make real API within short time and do a PR.

But maybe all of this is just a nice to have, but I don't think so.

I would like to hear the view from paper staff. If they agree I would start such a project.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

WOW, so yeah, this is actually how it used to work. I loaded up a 1.6.4 singleplayer world, and tried swapping between my hotbar and a chest inventory. I hovered over the item in the chest's inventory, and pressed a hotbar slot, and it doesn't swap the items. It puts the item in the requested hotbar slot, but then just readds the item that was in the hotbar slot to the player's inventory.

rustic folioBOT
#

Expected behavior

Equality compares the entire entity tag in addition to the fields added by paper.

An item stack with invisibility defined in the tag vs an item stack that had it defined via the item meta (and hence only on the field not the tag) would hence not be equal.
Can't skip the tag comparison, as other values might be on it that need comparing.

Needs further investigation.

Observed/Actual behavior

N/A

Steps/models to reproduce

N/A

Plugin and Datapack List

N/A

Paper version

N/A

Other

N/A

rustic folioBOT
#

Mainly so that you can spawn a Human easily and use it for NPCs.
Also I think that in the abstraction way it should be spawnable now. In NMS you can't spawn a ServerPlayer wihout hack but you can spawn a Player with ClientboundAddEntityPacket. This wasn't possible in earlier versions because it required ClientboundAddPlayerPacket which differed from the usal spawning. But this packet doesn't exist anymore.

rustic folioBOT
rustic folioBOT
#

Expected behavior

For the error to not occur

Observed/Actual behavior

When comparing ItemMetas, an error occurs
recent error when attempting to load Skript:

[01:09:31 ERROR]: Error occurred while enabling Skript v2.8.5-nightly-d649c836 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.equals(Object)" because "this.color" is null
	at org.bukkit.craftbukkit.inventory.CraftMetaColorableArmor.equalsCommon(CraftMetaColorableArmor.java:118) ~[paper-1.20.6.jar:1.20.6-101-f0bd0cc]
	at org.bukkit.craftbukkit.inventory.CraftItemFactory.equals(CraftItemFactory.java:415) ~[paper-1.20.6.jar:1.20.6-101-f0bd0cc]
	at org.bukkit.craftbukkit.inventory.CraftItemFactory.equals(CraftItemFactory.java:402) ~[paper-1.20.6.jar:1.20.6-101-f0bd0cc]
	at org.bukkit.craftbukkit.inventory.CraftMetaItem.equals(CraftMetaItem.java:1544) ~[paper-1.20.6.jar:1.20.6-101-f0bd0cc]
	at Skript.jar/ch.njol.skript.aliases.ItemData.compareItemMetas(ItemData.java:447) ~...
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

Only the /teleport command works in the world you are in

Observed/Actual behavior

Any type of plugin teleportation does not work

Steps/models to reproduce

Unsure

Plugin and Datapack List

<img width="506" alt="image" src="https://github.com/PaperMC/Paper/assets/68831580/31a156a1-e7c4-4edd-9968-03a3089a8d7d">

Paper version

This server is running Paper version git-Paper-496 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 7ac24a1 on ver/1.20.4)
You are running the latest version

Other

Whats the cause of this? I have disabled end and nether, I also tried disablingdisable-teleportation-suffocation-check: true

rustic folioBOT
#

Expected behavior

When an entity with passengers is teleported to a location with a null world, it is teleported successfully, retaining its passengers. This is consistent with the behaviour of teleporting an entity with no passengers to a location with a null world.

Observed/Actual behavior

The teleport fails.

Steps/models to reproduce

val vehicle = player.world.spawn(player.location, ItemDisplay::class.java) {
    it.addPassenger(player)
}

// at some point later
vehicle.teleport(Location(null, 0.0, 0.0, 0.0, 0.0, 0.0), TeleportFlag.EntityState.RETAIN_PASSENGERS)

### Plugin and Datapack List

None other than the minimum to reproduce with the above code

### Paper version

This server is running Paper version 1.20.6-97-master@377733d (2024-05-24T18:03:46Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)

### Other

_No response_
rustic folioBOT
rustic folioBOT
#

The previous PR #10375 removes block entities on setBlock calls to the WorldGen region to prevent the existence of a block entity on a block that does not support it as such.

The logic however assumed that such calls would always follow the order of:

  1. set the base blockstate
  2. create the block entity
  3. finish world gen

This is however not the case for all of world gen, specifically not for structure templates being placed under water, as these first set the block state, then configure its block entity (include the chests lootable) and finally waterlogs the chest by calling another setBlock.

To prevent this logic from deleting the original block entity, this commit now only removes the block entity found if the blockstate to be set differs from the previous one, matching LevelChunk#setBlockState.

Supersedes: #10768
Fixes: #10750

#

Expected behavior

I expected eat_seconds to increase the duration in which it takes to consume the item.

Observed/Actual behavior

An item with eat_seconds set to 2f or lower will work as expected, but beyond that things become very inconsistent.

For example, when eat_seconds is 2.1f, the item is consumed instantly. I noticed that with 10f, the item is slowly raised to your mouth but is then consumed in one bite while 11f is instant again. Similar to 10f, 6f will raise the item slowly but the player then takes a couple bites. If I had to estimate, 10f and 6f both take 3 seconds to consume the item.

Steps/models to reproduce

Give yourself an item with a food component where eat_seconds is any of the numbers mentioned above (or any other number, honestly).

/give @s bread[food={nutrition: 6, saturation: 4, eat_seconds: 2.1f}]

Plugin and Datapack List

There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]
...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Add a new event for when an entity "scares" another entity. As of 1.20.6, only armadillos can be scared.


As far as I could tell, there is no way* to prevent a player from scaring 1.20.5's armadillos and making them roll up into their shells. This adds a simple way to do so.

*tried: EntityPoseChangeEvent (not called for armadillos, also no scared-by entity reference), EntityTargetEvent (not called for armadillos)

Choices and Alternatives

  1. This event is called pre-cancelled when any living entity is within 7 blocks of the armadillo.

    • Pro: Plugins have full control over the conditions that scare an armadillo, such as adding more entities that scare armadillos.
    • Con: Lots of pre-cancelled events. Might be easy to misuse or log spam with ignoreCancelled = false.
    • Alternative: Only call the event when the scare actually happens, so that the event can be cancelled but not un-cancelled.
  2. The event is named generically.

    • Pro: Anything ...
rustic folioBOT
rustic folioBOT
#

Yes, the problem still presists and noone made solution / way how to prevent this shulker behaviour. Many servers have the same issue with shulkers.

It is hard to reproduce, but it happens.

Do I have an actual info, or has anything further been resolved on this matter?

I think this is just more of a challenge for a professional, I haven't done anything with it myself, I've tried a number of things.

rustic folioBOT
rustic folioBOT
#

Expected behavior

Players to chat and then run commands without being kicked.

Observed/Actual behavior

Players typing in chat, then run a command and it fails to validate message acknowledgements, resulting in kicking them from the server. Even lowered from Purpur (a fork of paper) down to paper, and velocity to a lower version before 1.20.6 support. Issues still persist.
PaperServer
VelocityServer

Steps/models to reproduce

Use Velocity and Paper Version 1.20.4 to type in chat at least twice, then run a command like gamemode spectator.

Plugin and Datapack List

Started with a lot of plugins, eventually moved all of them away to try to fix the issue. Result was same issue.

Paper version

Paper:
[00:17:34 INFO]: Checking version, please wait...
[00:17:35 INFO]: This server is...

rustic folioBOT
#

Expected behavior

When having 2 entities stand right behind each other. cancelling the ProjectileHitEvent would result in the event being called once for the first entity and once for the second entity.

Observed/Actual behavior

the event only gets called once for the closest entity to the shooter however not for the second entity

Steps/models to reproduce

cancel ProjectileHitEvent and print out when the event gets called with the playername. line up 2 players/entities (i would just use 2 players since this issue also relies on how big the hitbox of the entity is) as close as possible behind each other. shoot straight through both entites/players. see that the event only got called once

Plugin and Datapack List

just a test plugin to cancel the event

Paper version

[10:12:21 INFO]: Checking version, please wait...
[10:12:21 INFO]: This server is running Paper version 1.20.6-113-master@23fe116 (2024-05-27T17:40:35Z) (Implementing API version 1.20.6-R0.1-SNA...

rustic folioBOT
#
[PaperMC/Paper] branch deleted: api-capabilities
#
[PaperMC/Paper] branch deleted: feature/daemon
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

To add metadata to blocks.

Observed/Actual behavior

As of 1.20.5+, this does no longer work - No visible errors.

Steps/models to reproduce

By adding metadata to blocks.

Plugin and Datapack List

[19:06:13 INFO]: Server Plugins (26):
[19:06:13 INFO]: Paper Plugins:
[19:06:13 INFO]: - AdvancedKits
[19:06:13 INFO]: Bukkit Plugins:
[19:06:13 INFO]: - AuraSkills, Citizens, DecentHolograms, FastAsyncWorldEdit, ItemEdit, LuckPerms, Multiverse-Core, PlaceholderAPI, SuperiorSkyblock2, SupremeChat
[19:06:13 INFO]: SupremeCollections, SupremeCore, SupremeCrafting, SupremeCurrency, SupremeEnchantments, SupremeEssentials, SupremeLevels, SupremeMenus, SupremeMinions, SupremeTelepads
[19:06:13 INFO]: SupremeTrades, SupremeTriggers, TAB, Vault, WorldGuard

[19:05:06 INFO]: There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]
[19:05:06 INFO]: There are no more data packs available

Paper version

[1...

#

Is your feature request related to a problem?

Ancient city can't use in paper api

Describe the solution you'd like.

Ancient city was added in minecraft in 1.19.Now minecraft is nearly 1.21.But i still can't find ancient city in the paper api ใ€‚org.bukkit.structuretype maybe still 1.18

Describe alternatives you've considered.

spigot bukkit have no classes to due with structure

Other

No response

#

Please provide simple reproduction code here. Are you talking about https://jd.papermc.io/paper/1.20.6/org/bukkit/metadata/Metadatable.html ?

Thanks for the quick reply. Yes, I'm talking about https://jd.papermc.io/paper/1.20.6/org/bukkit/metadata/Metadatable.html

You can simply reproduce it to apply a metadata to any block and check whether it has been added.

The issue lies with 1.20.5+, it worked fine on 1.20.4 and lower.

rustic folioBOT
#

I am having trouble replicating this.
The following example code

@EventHandler
public void on(final PlayerDropItemEvent event) {
    final Block targetBlockExact = event.getPlayer().getTargetBlockExact(10);
    if (targetBlockExact == null) return;

    targetBlockExact.setMetadata("testplugin:testdata", new FixedMetadataValue(this, "hi"));
    targetBlockExact.getMetadata("testplugin:testdata").stream()
        .map(m -> m.getOwningPlugin().getName() + " -> " + m.asString())
        .forEach(event.getPlayer()::sendRawMessage);
}

prints me "Paper-Test-Plugin -> hi" when dropping an item while looking (in this case) sand.

Do you have any minimal reproduction steps here?

rustic folioBOT
rustic folioBOT
#

The previous code assumed that PotionContents#getColor always returned a RGB color without alpha channel. However that's not the case it returns an ARGB color even for opaque color, the alpha channel is set to 0xFF. Only AreaEffectCloud always have an opaque RGB color and will force the last byte to 0xFF.

The following things happen:

  • AreaEffectCloud#getColor throw an argument exception with extraneous data.
  • Arrow#getColor would always return null no matter the color of the effect since the alpha channel is determined by the first byte of the integer. Which means for opaque color (0xFF) the first bit will be set to 1 and so negative color are fine. Only -1 is a special case here.
  • Arrow#setColor doesn't work since the alpha channel is not defined.
#

Is your feature request related to a problem?

The problem

When registering a command with a name that already exists in vanilla it overrides the vanilla variant without a namespace. However when said command has aliases that also exist in vanilla, those aliases don't override their vanilla variant.

For example:

I'd like to create a teleport command with the name "teleport" and alias "tp". When running "/teleport" my implementations gets executed instead of the vanilla one (as expected). But when I run "/tp" the vanilla implementation gets executed instead of mine.

Describe the solution you'd like.

Aliases for commands that also exist in vanilla should override the vanilla variant without a namespace.

Describe alternatives you've considered.

After looking at how vanilla handles aliases, I tried to manually register them by redirecting them to my command.

        LiteralCommandNode<CommandSourceStack> literalCommandNode = builder.build();
     ...
rustic folioBOT
#

Expected behavior

I have a command which gives the executor a glowing sign and broadcasts the glowing state of the sign. I expected the sign to be glowing when given and the broadcasts to say the sign is glowing.

> demo
[16:42:45 INFO]: Is the front glowing? true
[16:42:45 INFO]: Is the back glowing? true

Observed/Actual behavior

The sign was not glowing when given to the player and the broadcasts say the sign is not glowing.

> demo
[16:44:42 INFO]: Is the front glowing? false
[16:44:42 INFO]: Is the back glowing? false

Steps/models to reproduce

I have created a test plugin available at https://github.com/Pikachu920/blockstatemeta-issue. You can build that plugin and run the demo command (either in game or from console). The glowing state of the sign will be broadcast and, if in game, you ...

rustic folioBOT
#

Can you try the build that is linked at the top of this PR and see if it fixes your issue? #10812

yes, it does. thank you

> demo
[19:48:15 INFO]: Is the front glowing? true
[19:48:15 INFO]: Is the back glowing? true
> ver
[19:48:19 INFO]: Checking version, please wait...
[19:48:20 INFO]: This server is running Paper version 1.20.6-DEV-HEAD@89fff1d (2024-05-28T23:37:40Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)
rustic folioBOT
#

Expected behavior

not get kicked when chatting

Observed/Actual behavior

chat chain is broken and players get kicked

Steps/models to reproduce

  1. Set misc.chat-threads.chat-executor-max-size to 1 in config/paper-global.yml
  2. Start the server, join and try to chat. The first message sent will trigger an exception and a stack trace will be shown from the chat thread pool, following messages will kick the player

Plugin and Datapack List

N/A

Paper version

Paper version 1.20.6-115-master@9d6f2cc

Other

[23:23:33] [User Authenticator #0/INFO]: UUID of player emilyy_dev is 33ae6cd1-f352-45b1-8a98-39ede5284d5e
[23:23:33] [Server thread/INFO]: emilyy_dev joined the game
[23:23:33] [Server thread/INFO]: emilyy_dev[/127.0.0.1:50710] logged in with entity id 240 at ([world]-98.96601467549034, 100.0, 705.1372853987785)
[23:23:37] [Async Chat Thread - #0/ERROR]: Chain link failed, continuing to next one
java.util.concurrent.RejectedExecutionExcept...
rustic folioBOT
#

The exception comes from the FutureChain, the new future that is appended is already running in the chat thread, and the thenAcceptAsync tries to schedule a new task on the same executor that is currently busy.
The chat executor is a ThreadPoolExecutor using a SynchronousQueue, that means it can only schedule tasks if there is a thread waiting for one, and given the max pool size is 1 and that thread is currently busy, it rejects the task.

#

Expected behavior

/minecraft:tp should function the same as the regular /tp, /teleport, and /minecraft:teleport commands

Observed/Actual behavior

The command doesn't allow any arguments

Steps/models to reproduce

Type /minecraft:tp with any args after and see that it doesn't work

Plugin and Datapack List

image

Paper version

This server is running Paper version 1.20.6-115-master@9d6f2cc (2024-05-28T14:55:16Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)
You are running the latest version
Previous version: git-Paper-49 (MC: 1.20.6)

Other

Doesn't happen in Spigot or further upstream and only started in 1.20.6 AFAIK

rustic folioBOT
#

Is your feature request related to a problem?

commands like /w, /msg, and /tell are logged in console

Describe the solution you'd like.

either a config option to disable logging commands, or a config option to disable logging certain commands

Describe alternatives you've considered.

Making a plugin to override is loggable (https://bukkit.org/threads/how-can-i-prevent-the-console-from-logging-certain-commands.158152/) - this should be a config option

Other

No response

rustic folioBOT
#

Expected behavior

Please, fix this..

Observed/Actual behavior

[09:00:08 ERROR]: Error sending packet clientbound/minecraft:disconnect (skippable? false)
io.netty.handler.codec.EncoderException: Sending unknown packet 'clientbound/minecraft:disconnect'
at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:46) ~[paper-1.20.6.jar:1.20.6-115-9d6f2cc]
at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:20) ~[paper-1.20.6.jar:1.20.6-115-9d6f2cc]
at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:26) ~[paper-1.20.6.jar:1.20.6-115-9d6f2cc]
at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:12) ~[paper-1.20.6.jar:1.20.6-115-9d6f2cc]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:...

#

Hey JasonHorkles, cheers for making this issue. I can reproduce this.

Vanilla 1.20.6:
/teleport @s 100 100 100 and /tp @s 100 100 100 work as intended.

Paper 1.20.4 (build 496):

  • /teleport @s 100 100 100 and /tp @s 100 100 100 work as intended.
  • /minecraft:teleport @s 100 100 100 and /minecraft:tp @s 100 100 100 work as intended.

Paper 1.20.6 (build 115):

  • /teleport @s 100 100 100 and /tp @s 100 100 100 work as intended.
  • /minecraft:teleport @s 100 100 100 works as intended and /minecraft:tp @s 100 100 100 doesn't work/accept arguments. The latter also doesn't provide any tab completable options like the former but still shows as a registered command:

nxJ6Wha
ecdlskQ

rustic folioBOT
#

Expected behavior

The problem:

The backward capability of there's methods was broken in Paper 1.20.5. No more there's methods exist on Paper API 1.20.5+:

ItemMeta#getDestroyableKeys()
ItemMeta#getPlaceableKeys()
ItemMeta#hasDestroyableKeys()
ItemMeta#hasPlaceableKeys()
ItemMeta#setDestroyableKeys(@NotNull Collection<Namespaced> canDestroy)
ItemMeta#setPlaceableKeys(@NotNull Collection<Namespaced> canPlaceOn)

Comparation:
1.20.4 API: https://jd.papermc.io/paper/1.20.4/org/bukkit/inventory/meta/ItemMeta.html
1.20.5 API: https://jd.papermc.io/paper/1.20.5/org/bukkit/inventory/meta/ItemMeta.html

Ways to solve i see:

  • Reimplement listed methods and mark it as deprecated if necessary.
  • If it hard to implement correctly, it must just do nothing (with print warning to logs most likely).
  • It can also throw exception with understandable description (not preferred as it will break plugins logic).

Observed/Actual behavior

Paper 1.20.6 marked as st...

rustic folioBOT
#

Expected behavior

Usually I can call

Player player = getPlayer();
for (EquipmentSlot slot : EquipmentSlot.values()) {
    player.getInventory().getItem(slot);
    // or
    player.getEquipment().getItem(slot);
}

and get all player equipment this way.

Observed/Actual behavior

However, the getter for new EquipmentSlot BODY is not implemented for CraftInventoryPlayer.

java.lang.IllegalArgumentException: Not implemented. This is a bug
        at org.bukkit.craftbukkit.inventory.CraftInventoryPlayer.getItem(CraftInventoryPlayer.java:166)

Steps/models to reproduce

Call

player.getInventory().getItem(EquipmentSlot.BODY);

This should simply return null because iterating over EquipmentSlot was a common shortcut to iterate over a player's inventory in Paper 1.20.4 and prior. Instead, an exception is thrown, breaking existing plugins.

Plugin and Datapack List

plugins
Server Plugins (58):
Bukkit Plugins:

  • AFK, Ar...
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Yes, this was noted in the release notes. That API was no longer able to represent the underlying data, and keeping it around as-is would just break itemstacks, basically

Well, what's the workaround we have right now?
Check if method exist before calling it (using reflection)?
Also we need to tell plugins users on 1.20.5+ that some of the functionality doesn't work?

rustic folioBOT
rustic folioBOT
#

Expected behavior

When I use the dungeon plugin to repeatedly unload and add worlds, the memory just always grows, which is very strange, when I use java heap dump I found that the unloaded worlds have loaded chunks
image
image
image
image
image

image

Observed/Actual behavior

The world should not remain in memory after unloading

Steps/models to reproduce

repeatedly unload and add worlds

Plugin and Datapack List

![image](...

rustic folioBOT
#

Well I'd much rather it return an empty stack instead of null, but moving past that, I wonder if it isn't better API to throw for invalid equipment slots. Certainly I think the setter for a certain slot should throw instead of just doing nothing and not informing the user at all that they are taking an invalid action. And then it seems weird that one interaction returns empty and the other throws.

rustic folioBOT
rustic folioBOT
#

Stack trace

https://paste.gg/p/anonymous/56942441b7fa4a25817c9c275b2d6bc2

Plugin and Datapack List

terralith DP
chunky
chunky border
bluemap

Actions to reproduce (if known)

just disconnect from the server

Paper version

"This server is running Paper version 1.20.6-115-master@9d6f2cc (2024-05-28T14:55:16Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)"

Other

The server doesn't crash or anything, but I don't understand why it is throwing this error

rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: cre-not-called
rustic folioBOT
#

Closing this as it is completely unfeasible to have an actual Player instance on the server that is not a ServerPlayer.
A lot of the server code expects these things to be a ServerPlayer, hacking in a player implementation like this will explode everything.

There are a lot of existing frameworks to create and manage NPCs by the community, I'd recommend using one of these instead of spawning a custom player instance like this. Not to mention how this would mess with plugins or the likes.

I hope you can understand why paper is not interested in such a change ๐Ÿ‘
Thank you anyway for the work.

#
[PaperMC/Paper] New branch created: AsyncPlayerSendCommandsEvent-CSS
rustic folioBOT
#

Expected behavior

When redirecting aliases to a command using LiteralArgumentBuilder.redirect(LiteralCommandNode) the alias should execute said command.

Observed/Actual behavior

Aliases get sent to the client, however upon executing an unknown or incomplete command exception gets thrown. When using an alias without a namespace arguments don't get recognized and are marked as incorrect as well.

Steps/models to reproduce

Create a command using the brigadier API and add an alias that redirects to this command.

        LiteralArgumentBuilder<CommandSourceStack> builder = Commands.literal("teleport");
        builder.requires(commandSourceStack -> commandSourceStack.getSender().hasPermission("example.command.teleport"))
                .then(Commands.argument("target", ArgumentTypes.player()))
                .executes(source -> {
                    Player player = source.getArgument("target", PlayerSelectorArgumentResolver.class).resolve(source.getSource())...
rustic folioBOT
#

Well, first thing is that the structure of this command is probably not what you thought it was. You aren't marking the "argument" as executable. You need to call .executes() on the argument like this:

LiteralArgumentBuilder<CommandSourceStack> builder = Commands.literal("teleport");
builder
    .requires(commandSourceStack -> commandSourceStack.getSender().hasPermission("example.command.teleport"))
    .then(Commands.argument("target", ArgumentTypes.player())
        .executes(source -> {
            Player player = source.getArgument("target", PlayerSelectorArgumentResolver.class).resolve(source.getSource()).getFirst();
            source.getSource().getSender().sendMessage("Teleporting to %s".formatted(player.getName()));
            return 1;
        })
    );

Then at least doing /teleport @p does successfully teleport the player to itself.

#

As for the problem that still exists if you fix ^, I guess I'd recommend just avoiding brigadier's "redirect" system if possible. There are inconsistencies within the library itself which can lead to all sorts of unexpected behavior. For example, the actually dispatcher logic does not handle double redirects at all (a redirect to a redirect to an executable). For root literals, I would just use the "aliases" collection parameter in the various register methods.

#

Yea sorry, it's pretty late and I quickly put together this example with a foggy brain. However, even with a correct structure the issue still persists. I was told to open up an issue on the Discord server as this is not intented behavior. Using the aliases collection in the register method does indeed work correctly, but I wanted to override the vanilla alias so I had to use redirect as using the register method will not override these.

#

Expand out the datapack API with more functionality.

Will squash into the main datapack patches when merged.

I think the WeakReference is the way to go with Pack references? Those are re-created everytime the PackRespository refreshes which can happen a lot, so holding onto them isn't ideal (like upstream's datapack implementation does).

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Imo, while the brig redirect system seems to be a bit of a mess, this is still solvable by us.
Some may not be.

A) A node that does not have children cannot be redirected to from a single node.
The CommandDispatcher only resolves redirects if the reader can read post the initial literal node (e.g. arguments are provided).
Annoying.
B) When flattening an alias redirect (either because child.len == 0 or the internal flag was passed) the logic does not take into
account that the root of the alias itself might be a redirect.

So we'd need to fix brigadiers redirect BS by flattening them all (both the directly registered redirect and the then registered alias) to directly redirect or be a flattened copy of the redirect target in case of 0 children.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

See this in player list name :
<img width="305" alt="image" src="https://github.com/PaperMC/Paper/assets/17381066/8f2ea13f-77bf-48f2-8067-c8ab522500e1">

Observed/Actual behavior

When using ยงx color code (full string: ยงxยงfยงfยง0ยง0ยง0ยง0ยงxยงfยงfยง0ยง0ยง0ยง0ยงlFONDATEURยงr ยง8โ– ยงxยงfยงfยง0ยง0ยง0ยง0Elikill58) :
<img width="315" alt="image" src="https://github.com/PaperMC/Paper/assets/17381066/85dd80e8-f85d-4a81-b9f6-91a2f6fec906">

When using &# (full string: &#ff0000&#ff0000ยงlFONDATEURยงr ยง8โ– &#ff0000Elikill58) :
<img width="580" alt="image" src="https://github.com/PaperMC/Paper/assets/17381066/682e111c-45b3-462a-8565-bd7b23ba0efc">

Steps/models to reproduce

Use this string : &#ff0000&#ff0000ยงlFONDATEURยงr ยง8โ– &#ff0000Elikill58 or ยงxยงfยงfยง0ยง0ยง0ยง0ยงxยงfยงfยง0ยง0ยง0ยง0ยงlFONDATEURยงr ยง8โ– ยงxยงfยงfยง0ยง0ยง0ยง0Elikill58.
By using player.setPlayerListName(name) it's working, but with player.playerListName(name) I get the result showed before. I tried `player.playerL...

#

the playerListName(Component) methods don't take a string. It's not supported behavior to put legacy color codes inside of a component. If you want to use legacy, not good, super old, lossy string format like the legacy color codes, you have to use the LegacyComponentSerializer and deserialize the string from there into a component.

Oh yes, I tested with wrong Serializer. I tested with Legacy one, and it's fixed thanks :)

rustic folioBOT
#
[PaperMC/Paper] branch deleted: AsyncPlayerSendCommandsEvent-CSS
rustic folioBOT
#
[PaperMC/Paper] New branch created: fix/knockback-events
#

Stack trace

[21:28:14 ERROR]: Error occurred while enabling TestStructure v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalArgumentException: Coordinates -16, 74, 33 are not in the region
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:463) ~[guava-32.1.2-jre.jar:?]
        at org.bukkit.craftbukkit.generator.CraftLimitedRegion.getBlockState(CraftLimitedRegion.java:185) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
        at org.bukkit.craftbukkit.util.CraftStructureTransformer.transformCraftState(CraftStructureTransformer.java:117) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
        at net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.placeInWorld(StructureTemplate.java:298) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
        at org.bukkit.craftbukkit.structure.CraftStructure.place(CraftStructure.java:99) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
        at org.bukkit.craftbukkit.structure.CraftStructure.place(CraftStruct...
rustic folioBOT
#

Expected behavior

for the event to be called

Observed/Actual behavior

I noticed after the big command API update, the TabCompleteEvent is no longer being called

Steps/models to reproduce

just some simple code

@EventHandler
public void onTabComplete(TabCompleteEvent event) {
    Bukkit.broadcastMessage("tab complete");
}

Plugin and Datapack List

[13:14:09 INFO]: Server Plugins (10):
[13:14:09 INFO]: Bukkit Plugins:
[13:14:09 INFO]: - BeeConomy, PermissionsEx, RandomTeleport, SkBee, SkBriggy, Skript, skript-reflect, spark, StressTestBots, Vault

Paper version

[13:14:14 INFO]: Checking version, please wait...
[13:14:15 INFO]: This server is running Paper version 1.20.6-124-master@0fcf3e3 (2024-05-29T22:05:27Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)
You are 2 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
Previous version: 1.20.6-112-347bbe3 (MC: 1.20.6)

Other

No response

#
[PaperMC/Paper] branch deleted: fix/knockback-events
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Add a new event for when an entity avoids another entity.


This is a replacement for https://github.com/PaperMC/Paper/pull/10798. The original intent was to fire an event when an armadillo rolls up, but this covers even more entities to be as generic as possible.

Affected Entities

I tested with these entities (all entities that have an AvoidEntityGoal, plus extra handling for armadillos and villagers). Cancelling the event behaves as expected, and in some cases, ends violently.

  • Fish -> Player
  • Dolphin -> Guardian
  • Fox -> Player, Wolf, Polar Bear
  • Skeleton -> Wolf
  • Creeper -> Ocelot, Cat
  • Evoker -> Player
  • Spider -> Armadillo
  • Wandering Trader -> Zombie and Illager variants
  • Ocelot, Cat -> Player
  • Panda -> Player
  • Rabbit -> Player
  • Wolf -> Llama
  • Armadillo -> Player
  • Villager -> Zombie and Illager variants

(should this be documented somewhere?)

rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: bugfix/itemstack-damage-api
#

ItemStack#damage internally uses ItemStack#hurtAndBreak, which previously would call a Consumer in case the item broke. Since 1.20.5 the break game event logic however resides in said method and was using the equipment slot passed, which is null in the case of the API ItemStack#damage method.

This commit prevents the NPE by first null checking the slot. Addittionally, hurtAndBreak also now checks if the player has infinite materials, e.g. is in creative mode, to prevent damaging the item.

As such as filter is undesirable for API calls, this commit also skips this logic in case of an API invocation.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

I'd like to use the goals api to change mob behaviour. It's working very nicely for the mobs that are mapped. But, for some mobs, such as Piglins, the Bukkit.getAllGoals() doesn't return any goals (Not even inherited from Creaturs/Monster). So I can't remove or replace goals.

Looking at this file VanillaGoal.java, there seems to be a mapping for crossbow attack, but it's not mapped to any creature.

https://github.com/PaperMC/Paper/blob/master/paper-api-generator/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java

Describe the solution you'd like.

Add Default mapping of monster and creture inheritance of all mobs respectively for future-proofing

Describe alternatives you've considered.

I've looked into workarounds but I'm not savvy enough to get anywhere.

Other

This is my function to make monsters passive.

For zombies, skeletons, etc. it works. But here are some mobs that don't:
No goals fo...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

No it is not related to any problem.

Describe the solution you'd like.

Like Velocity remove the /callback command from the AvailableCommandsPacket so it is not sent, as it is only used for internal processes and should not be executed by players themselves.

Describe alternatives you've considered.

Alternatively, the command could be removed by the PlayerCommandSendEvent.

Other

No response

rustic folioBOT
#

The CraftBlockStateMeta constructor CraftBlockStateMeta(Map) invokes its parent constructor, which itself invokes deserializeInternal, which is implemented on CraftBlockStateMeta to read the components and block entity tag from the passed map.

Field initialization happens after the call to the super constructor, meaning the current code overwrites the parsed internal data with the EMPTY defaults.

This is prevented by moving the initialization into its own code block that can null check the fields prior to defaulting their value to EMPTY.

rustic folioBOT
#

Expected behavior

When we run this code:

        ItemStack item = new ItemStack(Material.LEATHER_CHESTPLATE);
        item.editMeta(ArmorMeta.class, m -> m.setTrim(new ArmorTrim(TrimMaterial.QUARTZ, TrimPattern.SILENCE)));
        Component component = Component.empty().hoverEvent(item.asHoverEvent());
        String string = GsonComponentSerializer.gson().serialize(component);

One would expect that the string variable now holds a nice representation of the chat component.

Observed/Actual behavior

Instead it throws and we get this lengthy error message

[14:39:19 WARN]: Unexpected exception while parsing console command "test"                                                                                                                                                         [80/1915]
org.bukkit.command.CommandException: Unhandled exception executing command 'test' in plugin Test v0.1
        at org.bukkit.command.PluginCommand.execute(PluginC...
rustic folioBOT
rustic folioBOT
#
[PaperMC/Paper] New branch created: item-datacomponent-api
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

I know you just PR'ed to the wrong repo.
But if you are planning on making a Paper fork, its highly recommend to use Paperweight for this instead of just forking the Github repository. It will make development and future maintenance of your fork much much easier.

See here for an example on how to create a fork with Paperweight. You can also look at other Paper forks, like Purpur or Pufferfish - they use paperweight too.

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT