Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting banner colour throws IllegalAccessError #4160

Open
SamB440 opened this issue Jan 15, 2025 · 2 comments
Open

Setting banner colour throws IllegalAccessError #4160

SamB440 opened this issue Jan 15, 2025 · 2 comments
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: bug Something isn't working

Comments

@SamB440
Copy link
Contributor

SamB440 commented Jan 15, 2025

Affected Product(s)

SpongeVanilla

Version

1.21.4-14.0.0-RC1998

Operating System

Linux

Java Version

21

Plugins/Mods

Not relevant

Describe the bug

Wasn't happening on previous version 1.21.1.

[20:08:02] [Server thread/ERROR] [sponge]: Could not pass GameShouldEndEvent to battlegrounds
java.lang.IllegalAccessError: Update to non-static final field net.minecraft.world.level.block.entity.BannerBlockEntity.baseColor attempted from a different method (bridge$setBaseColor) than the initializer method <init> 
        at TRANSFORMER/[email protected]/net.minecraft.world.level.block.entity.BannerBlockEntity.bridge$setBaseColor(BannerBlockEntity.java:1065) ~[minecraft_server-remapped.jar!/:?]
        at TRANSFORMER/[email protected]/org.spongepowered.common.data.provider.block.entity.BannerData.lambda$register$3(BannerData.java:64) ~[spongevanilla-mod.jar%232!/:1.21.4-14.0.0-RC0]
        at TRANSFORMER/[email protected]/org.spongepowered.common.data.provider.DataProviderRegistrator$MutableRegistrationBase$1.set(DataProviderRegistrator.java:359) ~[spongevanilla-mod.jar%232!/:1.21.4-14.0.0-RC0]
        at TRANSFORMER/[email protected]/org.spongepowered.common.data.provider.GenericMutableDataProviderBase.lambda$setAndGetResult$2(GenericMutableDataProviderBase.java:134) ~[spongevanilla-mod.jar%232!/:1.21.4-14.0.0-RC0]
        at java.base/java.util.Optional.map(Optional.java:260) ~[?:?]
        at TRANSFORMER/[email protected]/org.spongepowered.common.data.provider.GenericMutableDataProviderBase.setAndGetResult(GenericMutableDataProviderBase.java:132) ~[spongevanilla-mod.jar%232!/:1.21.4-14.0.0-RC0]
        at TRANSFORMER/[email protected]/org.spongepowered.common.data.provider.DataProviderRegistrator$MutableRegistrationBase$1.setAndGetResult(DataProviderRegistrator.java:388) ~[spongevanilla-mod.jar%232!/:1.21.4-14.0.0-RC0]
        at TRANSFORMER/[email protected]/org.spongepowered.common.data.provider.GenericMutableDataProviderBase.offer(GenericMutableDataProviderBase.java:242) ~[spongevanilla-mod.jar%232!/:1.21.4-14.0.0-RC0]
        at TRANSFORMER/[email protected]/org.spongepowered.common.data.holder.SpongeMutableDataHolder.lambda$offer$1(SpongeMutableDataHolder.java:76) ~[spongevanilla-mod.jar%232!/:1.21.4-14.0.0-RC0]
        at TRANSFORMER/[email protected]/org.spongepowered.common.data.holder.SpongeMutableDataHolder.impl$applyTransaction(SpongeMutableDataHolder.java:66) ~[spongevanilla-mod.jar%232!/:1.21.4-14.0.0-RC0]
        at TRANSFORMER/[email protected]/org.spongepowered.common.data.holder.SpongeMutableDataHolder.offer(SpongeMutableDataHolder.java:76) ~[spongevanilla-mod.jar%232!/:1.21.4-14.0.0-RC0]
        at TRANSFORMER/[email protected]/org.empirewar.battlegrounds.utils.BlockUtils.setFlagBlock(BlockUtils.java:105) ~[Battlegrounds-3.2.1.jar!/:?]

banner.offer(Keys.DYE_COLOR, dyeColor);

Link to logs

No response

@SamB440 SamB440 added status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: bug Something isn't working labels Jan 15, 2025
@gabizou
Copy link
Member

gabizou commented Jan 15, 2025

It seems like Banners can no longer change their base color natively and instead require changing the BlockState itself to change the base color. The trick with this is going to become that changing the Key will fundamentally change the block itself. Is this going to be desired? There are already the various colored block types available for each of the banners.

@SamB440
Copy link
Contributor Author

SamB440 commented Jan 15, 2025

If the banner block no longer defines the base colour then I think the key should become read only… having to change the block state makes more sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants