Sponge icon indicating copy to clipboard operation
Sponge copied to clipboard

Setting banner colour throws IllegalAccessError

Open SamB440 opened this issue 11 months ago • 2 comments

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 avatar Jan 15 '25 21:01 SamB440

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.

gabizou avatar Jan 15 '25 22:01 gabizou

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

SamB440 avatar Jan 15 '25 23:01 SamB440