Beacons have code for custom names, but the GUI doesn't render the name and the custom name isn't saved to NBT
The bug
Beacons have code to store a display name (all information based off of MCP 940):
BlockBeacon
/**
* Called by ItemBlocks after a block is set in the world, to allow post-place logic
*/
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
if (stack.hasDisplayName()) {
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityBeacon) {
((TileEntityBeacon)tileentity).setName(stack.getDisplayName());
}
}
}
There also is a custom name field in the block entity (customName
), but it is never saved or loaded:
public void readFromNBT(NBTTagCompound compound) {
super.readFromNBT(compound);
this.primaryEffect = isBeaconEffect(compound.getInteger("Primary"));
this.secondaryEffect = isBeaconEffect(compound.getInteger("Secondary"));
this.levels = compound.getInteger("Levels");
}
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
super.writeToNBT(compound);
compound.setInteger("Primary", Potion.getIdFromPotion(this.primaryEffect));
compound.setInteger("Secondary", Potion.getIdFromPotion(this.secondaryEffect));
compound.setInteger("Levels", this.levels);
return compound;
}
Since there is code to set the custom name when placing a block, and fields to actually store that name, it seems likely that it was intended for the name to be visible. However, the actual beacon GUI doesn't display it.
Possible fixes
Add code to render the beacon display name in the GUI and store the custom name field
OR
Remove the currently unused code for the custom names
"the currently unused code" just pointing out, it's not unused, it is stored in memory and the beacon will drop a beacon with the correct name, unless it became unloaded at any given point.