16 lines
		
	
	
	
		
			502 B
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
	
		
			502 B
		
	
	
	
		
			Java
		
	
	
	
	
	
| package net.minecraft.world.item;
 | |
| 
 | |
| import net.minecraft.core.component.DataComponents;
 | |
| import net.minecraft.network.chat.Component;
 | |
| 
 | |
| public class ShieldItem extends Item {
 | |
| 	public ShieldItem(Item.Properties properties) {
 | |
| 		super(properties);
 | |
| 	}
 | |
| 
 | |
| 	@Override
 | |
| 	public Component getName(ItemStack stack) {
 | |
| 		DyeColor dyeColor = stack.get(DataComponents.BASE_COLOR);
 | |
| 		return (Component)(dyeColor != null ? Component.translatable(this.descriptionId + "." + dyeColor.getName()) : super.getName(stack));
 | |
| 	}
 | |
| }
 |