Skip to content

Allow shields to use banner meta#745

Closed
malonnnn wants to merge 2 commits into
EssentialsX:2.xfrom
malonnnn:2.x
Closed

Allow shields to use banner meta#745
malonnnn wants to merge 2 commits into
EssentialsX:2.xfrom
malonnnn:2.x

Conversation

@malonnnn
Copy link
Copy Markdown

No description provided.

@malonnnn malonnnn changed the title 2 x Allow shields to use banner meta Jul 18, 2016
@fieu
Copy link
Copy Markdown

fieu commented Jul 19, 2016

Has this been added and will have support in next release ?

@SupaHam
Copy link
Copy Markdown
Member

SupaHam commented Jul 22, 2016

This PR is incomplete as the deserialization needs to be implemented as well. Please make sure you test PRs before you submit them.

P.S. Spigot does not provide support for Shield meta at this point in time.

@SupaHam SupaHam closed this Jul 22, 2016
@malonnnn
Copy link
Copy Markdown
Author

malonnnn commented Jul 23, 2016

@SupaHam

Sorry that it's incomplete.

Spigot does support shield meta though, because this command works (sans colored name):

/give player minecraft:shield 1 0 {BlockEntityTag:{Base:14,Patterns:[{Pattern:gra,Color:11},{Pattern:gru,Color:1},{Pattern:tt,Color:11},{Pattern:cbo,Color:0},{Pattern:tt,Color:0},{Pattern:moj,Color:0},{Pattern:mc,Color:0},{Pattern:bo,Color:0}]},display:{Name:§4§lAr§0§le§4§ls's §4Shield}}

So can this be added?

@SupaHam
Copy link
Copy Markdown
Member

SupaHam commented Jul 23, 2016

That's not a Spigot command. That's a Minecraft command. When I say Spigot I mean the Spigot API.

@md-5
Copy link
Copy Markdown
Contributor

md-5 commented Jul 25, 2016

Spigot does provide support for shield meta at this time (and has for several months).

            ItemStack shield = new ItemStack( Material.SHIELD );

            BlockStateMeta meta = (BlockStateMeta) shield.getItemMeta();
            Banner banner = (Banner) meta.getBlockState();

            banner.setBaseColor( DyeColor.BROWN );
            banner.addPattern( new Pattern( DyeColor.PINK, PatternType.CROSS ) );
            banner.addPattern( new Pattern( DyeColor.RED, PatternType.CREEPER ) );
            banner.update();

            meta.setBlockState( banner );
            shield.setItemMeta( meta );

            event.getPlayer().getInventory().addItem( shield );

@SupaHam
Copy link
Copy Markdown
Member

SupaHam commented Jul 25, 2016

@md-5 Is there a reason it's not done traditionally (i.e. via BannerMeta)?

@SupaHam
Copy link
Copy Markdown
Member

SupaHam commented Jul 25, 2016

This has been introduced in 352c92b. You can grab the feature from build 412 on the CI server.

@md-5
Copy link
Copy Markdown
Contributor

md-5 commented Jul 25, 2016

@md-5 Is there a reason it's not done traditionally (i.e. via BannerMeta)?

Ask Mojang. I think it's actually a pretty smart idea, attaching a banner directly to a shield. Much simpler to implement and allows for future possibilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants