Skip to content

refactor: unnecessary ducks#6232

Open
Kiriyaga7615 wants to merge 2 commits intoMeteorDevelopment:masterfrom
Kiriyaga7615:master
Open

refactor: unnecessary ducks#6232
Kiriyaga7615 wants to merge 2 commits intoMeteorDevelopment:masterfrom
Kiriyaga7615:master

Conversation

@Kiriyaga7615
Copy link

Type of change

  • Bug fix
  • New feature

Description

Useless accessor is used! in modern MC api field is public

Related issues

How Has This Been Tested?

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

@crosby-moe
Copy link
Collaborator

honestly the whole nametags bit can be replaced with

switch (entity) {
    case PlayerEntity player ->           renderNametagPlayer(event, player, shadow);
    case ItemEntity item ->               renderNametagItem(item.getStack(), shadow);
    case ItemFrameEntity itemFrame ->     renderNametagItem(itemFrame.getHeldItemStack(), shadow);
    case TntEntity tnt ->                 renderTntNametag(ticksToTime(tnt.getFuse()), shadow);
    case TntMinecartEntity tntMinecart -> renderTntNametag(ticksToTime(tntMinecart.getFuseTicks()), shadow);
    case LivingEntity living ->           renderGenericLivingNametag(living, shadow);
    default ->                            renderGenericNametag(entity, shadow);
}

@Kiriyaga7615
Copy link
Author

fair, ill just refactor it

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.

2 participants