PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.91k stars 2.29k forks source link

Unable to Clear All Patterns from a Placed Banner using Plugins #11487

Closed conure512 closed 3 days ago

conure512 commented 1 week ago

Expected behavior

You should be able to use the org.bukkit.block.Banner class to freely change the patterns on a placed banner, including removing all patterns if you wish.

Observed/Actual behavior

You can freely edit patterns in this manner, as long as the end state is that the banner still has some sort of pattern. If you try removing all patterns so the banner is empty, the banner remains unchanged (it keeps its previous patterns). This seems to only occur if the rest of the banner's state (banner type and rotation) is also unchanged.

Steps/models to reproduce

Here's the code from my plugin that highlights the issue. "bannerBlock" is an instance of org.bukkit.block.Block that points to the banner in the world, and the banner starts out with a pattern on it. Banner bannerState=(Banner)bannerBlock.getState(); while(bannerState.numberOfPatterns()>0) bannerState.removePattern(0); bannerState.update(true);

If you run this code, the banner remains unchanged. HOWEVER, the following code DOES work:

Banner bannerState=(Banner)bannerBlock.getState(); while(bannerState.numberOfPatterns()>0) bannerState.removePattern(0); bannerState.addPattern(some_pattern); bannerState.update(true);

Plugin and Datapack List

None except my own plugin where this issue occurred

Paper version

This server is running Paper version 1.21.1-120-master@57c75a4 (2024-10-09T21:11:07Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT) You are running the latest version Previous version: 1.21.1-57-b483da4 (MC: 1.21.1)

Other

No response

electronicboy commented 3 days ago

does the banner update if you relog? I think that this is a client bug

Machine-Maker commented 3 days ago

Opened a vanilla issue for this https://bugs.mojang.com/browse/MC-277736